Class ExtendedCommonTermsQuery


  • public class ExtendedCommonTermsQuery
    extends org.apache.lucene.queries.CommonTermsQuery
    Extended version of CommonTermsQuery that allows to pass in a minimumNumberShouldMatch specification that uses the actual num of high frequent terms to calculate the minimum matching terms.
    • Field Summary

      • Fields inherited from class org.apache.lucene.queries.CommonTermsQuery

        highFreqBoost, highFreqMinNrShouldMatch, highFreqOccur, lowFreqBoost, lowFreqMinNrShouldMatch, lowFreqOccur, maxTermFrequency, terms
    • Constructor Summary

      Constructors 
      Constructor Description
      ExtendedCommonTermsQuery​(org.apache.lucene.search.BooleanClause.Occur highFreqOccur, org.apache.lucene.search.BooleanClause.Occur lowFreqOccur, float maxTermFrequency)  
    • Constructor Detail

      • ExtendedCommonTermsQuery

        public ExtendedCommonTermsQuery​(org.apache.lucene.search.BooleanClause.Occur highFreqOccur,
                                        org.apache.lucene.search.BooleanClause.Occur lowFreqOccur,
                                        float maxTermFrequency)
    • Method Detail

      • calcLowFreqMinimumNumberShouldMatch

        protected int calcLowFreqMinimumNumberShouldMatch​(int numOptional)
        Overrides:
        calcLowFreqMinimumNumberShouldMatch in class org.apache.lucene.queries.CommonTermsQuery
      • calcMinimumNumberShouldMatch

        protected int calcMinimumNumberShouldMatch​(java.lang.String spec,
                                                   int numOptional)
      • calcHighFreqMinimumNumberShouldMatch

        protected int calcHighFreqMinimumNumberShouldMatch​(int numOptional)
        Overrides:
        calcHighFreqMinimumNumberShouldMatch in class org.apache.lucene.queries.CommonTermsQuery
      • setHighFreqMinimumNumberShouldMatch

        public void setHighFreqMinimumNumberShouldMatch​(java.lang.String spec)
      • getHighFreqMinimumNumberShouldMatchSpec

        public java.lang.String getHighFreqMinimumNumberShouldMatchSpec()
      • setLowFreqMinimumNumberShouldMatch

        public void setLowFreqMinimumNumberShouldMatch​(java.lang.String spec)
      • getLowFreqMinimumNumberShouldMatchSpec

        public java.lang.String getLowFreqMinimumNumberShouldMatchSpec()
      • getMaxTermFrequency

        public float getMaxTermFrequency()
        Overrides:
        getMaxTermFrequency in class org.apache.lucene.queries.CommonTermsQuery