java.lang.Object
org.apache.lucene.search.Query
org.elasticsearch.lucene.queries.BlendedTermQuery
public abstract class BlendedTermQuery
extends org.apache.lucene.search.Query
BlendedTermQuery can be used to unify term statistics across
 one or more fields in the index. A common problem with structured
 documents is that a term that is significant in on field might not be
 significant in other fields like in a scenario where documents represent
 users with a "first_name" and a "second_name". When someone searches
 for "simon" it will very likely get "paul simon" first since "simon" is a
 an uncommon last name ie. has a low document frequency. This query
 tries to "lie" about the global statistics like document frequency as well
 total term frequency to rank based on the estimated statistics.
 
 While aggregating the total term frequency is trivial since it
 can be summed up not every Similarity
 makes use of this statistic. The document frequency which is used in the
 ClassicSimilarity
 can only be estimated as an lower-bound since it is a document based statistic. For
 the document frequency the maximum frequency across all fields per term is used
 which is the minimum number of documents the terms occurs in.
 
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidblend(org.apache.lucene.index.TermStates[] contexts, int maxDoc, org.apache.lucene.index.IndexReader reader) static BlendedTermQuerydismaxBlendedQuery(org.apache.lucene.index.Term[] terms, float tieBreakerMultiplier) static BlendedTermQuerydismaxBlendedQuery(org.apache.lucene.index.Term[] terms, float[] boosts, float tieBreakerMultiplier) booleanList<org.apache.lucene.index.Term>getTerms()inthashCode()org.apache.lucene.search.Queryrewrite(org.apache.lucene.index.IndexReader reader) protected abstract org.apache.lucene.search.QuerytopLevelQuery(org.apache.lucene.index.Term[] terms, org.apache.lucene.index.TermStates[] ctx, int[] docFreqs, int maxDoc) voidvisit(org.apache.lucene.search.QueryVisitor visitor) Methods inherited from class org.apache.lucene.search.QueryclassHash, createWeight, sameClassAs, toString
- 
Constructor Details- 
BlendedTermQuerypublic BlendedTermQuery(org.apache.lucene.index.Term[] terms, float[] boosts) 
 
- 
- 
Method Details- 
rewritepublic org.apache.lucene.search.Query rewrite(org.apache.lucene.index.IndexReader reader) throws IOException - Overrides:
- rewritein class- org.apache.lucene.search.Query
- Throws:
- IOException
 
- 
topLevelQueryprotected abstract org.apache.lucene.search.Query topLevelQuery(org.apache.lucene.index.Term[] terms, org.apache.lucene.index.TermStates[] ctx, int[] docFreqs, int maxDoc) 
- 
blendprotected void blend(org.apache.lucene.index.TermStates[] contexts, int maxDoc, org.apache.lucene.index.IndexReader reader) throws IOException - Throws:
- IOException
 
- 
getTerms
- 
toString- Specified by:
- toStringin class- org.apache.lucene.search.Query
 
- 
visitpublic void visit(org.apache.lucene.search.QueryVisitor visitor) - Specified by:
- visitin class- org.apache.lucene.search.Query
 
- 
equals- Specified by:
- equalsin class- org.apache.lucene.search.Query
 
- 
hashCodepublic int hashCode()- Specified by:
- hashCodein class- org.apache.lucene.search.Query
 
- 
dismaxBlendedQuerypublic static BlendedTermQuery dismaxBlendedQuery(org.apache.lucene.index.Term[] terms, float tieBreakerMultiplier) 
- 
dismaxBlendedQuerypublic static BlendedTermQuery dismaxBlendedQuery(org.apache.lucene.index.Term[] terms, float[] boosts, float tieBreakerMultiplier) 
 
-