public static class PhraseQuery.Builder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.List<java.lang.Integer> |
positions |
private int |
slop |
private java.util.List<Term> |
terms |
Constructor and Description |
---|
Builder()
Sole constructor.
|
Modifier and Type | Method and Description |
---|---|
PhraseQuery.Builder |
add(Term term)
Adds a term to the end of the query phrase.
|
PhraseQuery.Builder |
add(Term term,
int position)
Adds a term to the end of the query phrase.
|
PhraseQuery |
build()
Build a phrase query based on the terms that have been added.
|
PhraseQuery.Builder |
setSlop(int slop)
Set the slop.
|
private int slop
private final java.util.List<Term> terms
private final java.util.List<java.lang.Integer> positions
public PhraseQuery.Builder setSlop(int slop)
PhraseQuery.getSlop()
public PhraseQuery.Builder add(Term term)
public PhraseQuery.Builder add(Term term, int position)
MultiPhraseQuery
instead which only requires one term at each position to match; this class requires
all of them.public PhraseQuery build()