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, MappedFieldType fieldType)
-
Method Summary
All Methods Instance Methods Concrete Methods 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()
protected org.apache.lucene.search.Query
newTermQuery(org.apache.lucene.index.Term term, org.apache.lucene.index.TermContext context)
void
setHighFreqMinimumNumberShouldMatch(java.lang.String spec)
void
setLowFreqMinimumNumberShouldMatch(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, rewrite, setHighFreqMinimumNumberShouldMatch, setLowFreqMinimumNumberShouldMatch, toString
-
-
-
-
Constructor Detail
-
ExtendedCommonTermsQuery
public ExtendedCommonTermsQuery(org.apache.lucene.search.BooleanClause.Occur highFreqOccur, org.apache.lucene.search.BooleanClause.Occur lowFreqOccur, float maxTermFrequency, MappedFieldType fieldType)
-
-
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
-
newTermQuery
protected org.apache.lucene.search.Query newTermQuery(org.apache.lucene.index.Term term, org.apache.lucene.index.TermContext context)
- Overrides:
newTermQuery
in classorg.apache.lucene.queries.CommonTermsQuery
-
-