java.lang.Object
org.apache.lucene.search.Query
org.apache.lucene.search.MultiTermQuery
com.atlassian.confluence.impl.search.v2.lucene.TermsQuery
All Implemented Interfaces:
Cloneable

public class TermsQuery extends org.apache.lucene.search.MultiTermQuery
A copy from org.apache.lucene.search.join.JoinUtil.TermsQuery. Note that the default rewrite method of MultiTermQuery doesn't calculate score which means it acts merely as a filter.
Since:
7.17
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.apache.lucene.search.MultiTermQuery

    org.apache.lucene.search.MultiTermQuery.ConstantScoreAutoRewrite, org.apache.lucene.search.MultiTermQuery.RewriteMethod, org.apache.lucene.search.MultiTermQuery.TopTermsBoostOnlyBooleanQueryRewrite, org.apache.lucene.search.MultiTermQuery.TopTermsScoringBooleanQueryRewrite
  • Field Summary

    Fields inherited from class org.apache.lucene.search.MultiTermQuery

    CONSTANT_SCORE_AUTO_REWRITE_DEFAULT, CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE, CONSTANT_SCORE_FILTER_REWRITE, field, rewriteMethod, SCORING_BOOLEAN_QUERY_REWRITE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    TermsQuery(String field, org.apache.lucene.util.BytesRefHash terms)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    protected org.apache.lucene.index.TermsEnum
    getTermsEnum(org.apache.lucene.index.Terms terms, org.apache.lucene.util.AttributeSource atts)
     
    int
     
    toString(String string)
     

    Methods inherited from class org.apache.lucene.search.MultiTermQuery

    getField, getRewriteMethod, getTermsEnum, rewrite, setRewriteMethod

    Methods inherited from class org.apache.lucene.search.Query

    clone, createWeight, extractTerms, getBoost, setBoost, toString

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • TermsQuery

      public TermsQuery(String field, org.apache.lucene.util.BytesRefHash terms)
      Parameters:
      field - The field that should contain terms that are specified in the previous parameter
      terms - The terms that matching documents should have. The terms must be sorted by natural order.
    • TermsQuery

      public TermsQuery(String field, Collection<String> terms)
  • Method Details

    • getTermsEnum

      protected org.apache.lucene.index.TermsEnum getTermsEnum(org.apache.lucene.index.Terms terms, org.apache.lucene.util.AttributeSource atts) throws IOException
      Specified by:
      getTermsEnum in class org.apache.lucene.search.MultiTermQuery
      Throws:
      IOException
    • toString

      public String toString(String string)
      Specified by:
      toString in class org.apache.lucene.search.Query
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class org.apache.lucene.search.MultiTermQuery
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class org.apache.lucene.search.MultiTermQuery