Package org.apache.lucene.search
Class SynonymQuery.Builder
- java.lang.Object
-
- org.apache.lucene.search.SynonymQuery.Builder
-
- Enclosing class:
- SynonymQuery
public static class SynonymQuery.Builder extends Object
A builder forSynonymQuery
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SynonymQuery.Builder
addTerm(Term term)
Adds the providedterm
as a synonym.SynonymQuery.Builder
addTerm(Term term, float boost)
Adds the providedterm
as a synonym, document frequencies of this term will be boosted byboost
.SynonymQuery.Builder
addTerm(BytesRef term, float boost)
Adds the providedterm
as a synonym, document frequencies of this term will be boosted byboost
.SynonymQuery
build()
Builds theSynonymQuery
.
-
-
-
Constructor Detail
-
Builder
public Builder(String field)
Sole constructor- Parameters:
field
- The target field name
-
-
Method Detail
-
addTerm
public SynonymQuery.Builder addTerm(Term term)
Adds the providedterm
as a synonym.
-
addTerm
public SynonymQuery.Builder addTerm(Term term, float boost)
Adds the providedterm
as a synonym, document frequencies of this term will be boosted byboost
.
-
addTerm
public SynonymQuery.Builder addTerm(BytesRef term, float boost)
Adds the providedterm
as a synonym, document frequencies of this term will be boosted byboost
.
-
build
public SynonymQuery build()
Builds theSynonymQuery
.
-
-