Package org.apache.lucene.queries
Class ExtendedCommonTermsQuery
- java.lang.Object
-
- org.apache.lucene.search.Query
-
- org.apache.lucene.queries.CommonTermsQuery
-
- org.apache.lucene.queries.ExtendedCommonTermsQuery
-
public class ExtendedCommonTermsQuery extends org.apache.lucene.queries.CommonTermsQueryExtended version ofCommonTermsQuerythat allows to pass in aminimumNumberShouldMatchspecification that uses the actual num of high frequent terms to calculate the minimum matching terms.
-
-
Constructor Summary
Constructors Constructor Description ExtendedCommonTermsQuery(org.apache.lucene.search.BooleanClause.Occur highFreqOccur, org.apache.lucene.search.BooleanClause.Occur lowFreqOccur, float maxTermFrequency)
-
Method Summary
Modifier and Type Method Description protected intcalcHighFreqMinimumNumberShouldMatch(int numOptional)protected intcalcLowFreqMinimumNumberShouldMatch(int numOptional)protected intcalcMinimumNumberShouldMatch(java.lang.String spec, int numOptional)java.lang.StringgetHighFreqMinimumNumberShouldMatchSpec()java.lang.StringgetLowFreqMinimumNumberShouldMatchSpec()floatgetMaxTermFrequency()voidsetHighFreqMinimumNumberShouldMatch(java.lang.String spec)voidsetLowFreqMinimumNumberShouldMatch(java.lang.String spec)-
Methods inherited from class org.apache.lucene.queries.CommonTermsQuery
add, buildQuery, collectTermContext, equals, getHighFreqBoost, getHighFreqMinimumNumberShouldMatch, getHighFreqOccur, getLowFreqBoost, getLowFreqMinimumNumberShouldMatch, getLowFreqOccur, getTerms, hashCode, newTermQuery, rewrite, setHighFreqMinimumNumberShouldMatch, setLowFreqMinimumNumberShouldMatch, toString
-
-
-
-
Method Detail
-
calcLowFreqMinimumNumberShouldMatch
protected int calcLowFreqMinimumNumberShouldMatch(int numOptional)
- Overrides:
calcLowFreqMinimumNumberShouldMatchin classorg.apache.lucene.queries.CommonTermsQuery
-
calcMinimumNumberShouldMatch
protected int calcMinimumNumberShouldMatch(java.lang.String spec, int numOptional)
-
calcHighFreqMinimumNumberShouldMatch
protected int calcHighFreqMinimumNumberShouldMatch(int numOptional)
- Overrides:
calcHighFreqMinimumNumberShouldMatchin classorg.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:
getMaxTermFrequencyin classorg.apache.lucene.queries.CommonTermsQuery
-
-