Class 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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(Object o)  
      protected org.apache.lucene.index.TermsEnum getTermsEnum​(org.apache.lucene.index.Terms terms, org.apache.lucene.util.AttributeSource atts)  
      int hashCode()  
      String 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
    • Constructor Detail

      • 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.
    • Method Detail

      • 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