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.CommonTermsQuery
Extended version ofCommonTermsQuery
that allows to pass in aminimumNumberShouldMatch
specification 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 int
calcHighFreqMinimumNumberShouldMatch(int numOptional)
protected int
calcLowFreqMinimumNumberShouldMatch(int numOptional)
protected int
calcMinimumNumberShouldMatch(java.lang.String spec, int numOptional)
java.lang.String
getHighFreqMinimumNumberShouldMatchSpec()
java.lang.String
getLowFreqMinimumNumberShouldMatchSpec()
float
getMaxTermFrequency()
void
setHighFreqMinimumNumberShouldMatch(java.lang.String spec)
void
setLowFreqMinimumNumberShouldMatch(java.lang.String spec)
-
Methods inherited from class org.apache.lucene.queries.CommonTermsQuery
add, buildQuery, collectTermStates, equals, getHighFreqBoost, getHighFreqMinimumNumberShouldMatch, getHighFreqOccur, getLowFreqBoost, getLowFreqMinimumNumberShouldMatch, getLowFreqOccur, getTerms, hashCode, newTermQuery, rewrite, setHighFreqMinimumNumberShouldMatch, setLowFreqMinimumNumberShouldMatch, toString
-
-
-
-
Method Detail
-
calcLowFreqMinimumNumberShouldMatch
protected int calcLowFreqMinimumNumberShouldMatch(int numOptional)
- Overrides:
calcLowFreqMinimumNumberShouldMatch
in classorg.apache.lucene.queries.CommonTermsQuery
-
calcMinimumNumberShouldMatch
protected int calcMinimumNumberShouldMatch(java.lang.String spec, int numOptional)
-
calcHighFreqMinimumNumberShouldMatch
protected int calcHighFreqMinimumNumberShouldMatch(int numOptional)
- Overrides:
calcHighFreqMinimumNumberShouldMatch
in 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:
getMaxTermFrequency
in classorg.apache.lucene.queries.CommonTermsQuery
-
-