@@ -0,0 +1,2331 @@
+/*%0A * Copyright 2012 The greplin-lucene-utils Authors.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage com.greplin.lucene.filter;%0A%0Aimport com.google.common.base.Objects;%0Aimport com.google.common.collect.Sets;%0Aimport org.apache.lucene.index.IndexReader;%0Aimport org.apache.lucene.index.Term;%0Aimport org.apache.lucene.index.TermDocs;%0Aimport org.apache.lucene.search.DocIdSet;%0Aimport org.apache.lucene.search.Filter;%0Aimport org.apache.lucene.util.FixedBitSet;%0A%0Aimport java.io.IOException;%0Aimport java.util.Set;%0A%0A/**%0A * Constructs a filter for docs matching any of the terms added to this class.%0A */%0Apublic class TermsFilter extends Filter %7B%0A%0A  /**%0A   * Terms to match.%0A   */%0A  private final Set%3CTerm%3E terms = Sets.newTreeSet();%0A%0A%0A  /**%0A   * Adds a term to the list of acceptable terms.%0A   * @param term the term to add.%0A   */%0A  public void addTerm(final Term term) %7B%0A    this.terms.add(term);%0A  %7D%0A%0A%0A  @Override%0A  public DocIdSet getDocIdSet(final IndexReader reader) throws IOException %7B%0A    FixedBitSet result = new FixedBitSet(reader.maxDoc());%0A    TermDocs td = reader.termDocs();%0A    try %7B%0A      for (Term term : this.terms) %7B%0A        td.seek(term);%0A        while (td.next()) %7B%0A          result.set(td.doc());%0A        %7D%0A      %7D%0A    %7D finally %7B%0A      td.close();%0A    %7D%0A    return result;%0A  %7D%0A%0A  @Override%0A  public boolean equals(final Object obj) %7B%0A    if (this == obj) %7B%0A      return true;%0A    %7D%0A    if ((obj == null) %7C%7C (obj.getClass() != this.getClass())) %7B%0A      return false;%0A    %7D%0A    TermsFilter that = (TermsFilter) obj;%0A    return that.terms.equals(this.terms);%0A  %7D%0A%0A  @Override%0A  public int hashCode() %7B%0A    return this.terms.hashCode();%0A  %7D%0A%0A%0A  @Override%0A  public String toString() %7B%0A    return Objects.toStringHelper(TermsFilter.class)%0A        .add(%22terms%22, this.terms)%0A        .toString();%0A  %7D%0A%7D%0A

Add TermsFilter fork with a good toString method