Package org.apache.lucene.search
Class PhraseQuery.Builder
java.lang.Object
org.apache.lucene.search.PhraseQuery.Builder
- Enclosing class:
- PhraseQuery
A builder for phrase queries.
-
Constructor Details
-
Builder
public Builder()Sole constructor.
-
-
Method Details
-
setSlop
Set the slop.- See Also:
-
add
Adds a term to the end of the query phrase. The relative position of the term is the one immediately after the last term added. -
add
Adds a term to the end of the query phrase. The relative position of the term within the phrase is specified explicitly, but must be greater than or equal to that of the previously added term. A greater position allows phrases with gaps (e.g. in connection with stopwords). If the position is equal, you most likely should be usingMultiPhraseQuery
instead which only requires one term at each position to match; this class requires all of them. -
build
Build a phrase query based on the terms that have been added.
-