Package org.apache.lucene.search
Class BlendedTermQuery.Builder
- java.lang.Object
-
- org.apache.lucene.search.BlendedTermQuery.Builder
-
- Enclosing class:
- BlendedTermQuery
public static class BlendedTermQuery.Builder extends Object
A Builder forBlendedTermQuery
.
-
-
Constructor Summary
Constructors Constructor Description Builder()
Sole constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BlendedTermQuery.Builder
add(Term term)
Add a newTerm
to this builder, with a default boost of1
.BlendedTermQuery.Builder
add(Term term, float boost)
Add aTerm
with the provided boost.BlendedTermQuery.Builder
add(Term term, float boost, TermStates context)
Expert: Add aTerm
with the provided boost and context.BlendedTermQuery
build()
Build theBlendedTermQuery
.BlendedTermQuery.Builder
setRewriteMethod(BlendedTermQuery.RewriteMethod rewiteMethod)
Set theBlendedTermQuery.RewriteMethod
.
-
-
-
Method Detail
-
setRewriteMethod
public BlendedTermQuery.Builder setRewriteMethod(BlendedTermQuery.RewriteMethod rewiteMethod)
Set theBlendedTermQuery.RewriteMethod
. Default is to useBlendedTermQuery.DISJUNCTION_MAX_REWRITE
.- See Also:
BlendedTermQuery.RewriteMethod
-
add
public BlendedTermQuery.Builder add(Term term)
Add a newTerm
to this builder, with a default boost of1
.- See Also:
add(Term, float)
-
add
public BlendedTermQuery.Builder add(Term term, float boost)
Add aTerm
with the provided boost. The higher the boost, the more this term will contribute to the overall score of theBlendedTermQuery
.
-
add
public BlendedTermQuery.Builder add(Term term, float boost, TermStates context)
Expert: Add aTerm
with the provided boost and context. This method is useful if you already have aTermStates
object constructed for the given term.
-
build
public BlendedTermQuery build()
Build theBlendedTermQuery
.
-
-