public static class PhraseWildcardQuery.Builder extends Object
PhraseWildcardQuery.| 限定符和类型 | 字段和说明 |
|---|---|
protected String |
field |
protected int |
maxMultiTermExpansions |
protected List<PhraseWildcardQuery.PhraseTerm> |
phraseTerms |
protected boolean |
segmentOptimizationEnabled |
protected int |
slop |
| 构造器和说明 |
|---|
Builder(String field,
int maxMultiTermExpansions) |
Builder(String field,
int maxMultiTermExpansions,
boolean segmentOptimizationEnabled) |
| 限定符和类型 | 方法和说明 |
|---|---|
PhraseWildcardQuery.Builder |
addMultiTerm(MultiTermQuery multiTermQuery)
Adds a multi-term at the next position in the phrase.
|
PhraseWildcardQuery.Builder |
addTerm(BytesRef termBytes)
Adds a single term at the next position in the phrase.
|
PhraseWildcardQuery.Builder |
addTerm(Term term)
Adds a single term at the next position in the phrase.
|
PhraseWildcardQuery |
build()
Builds a
PhraseWildcardQuery. |
PhraseWildcardQuery.Builder |
setSlop(int slop)
Sets the phrase slop.
|
protected final String field
protected final List<PhraseWildcardQuery.PhraseTerm> phraseTerms
protected int slop
protected final int maxMultiTermExpansions
protected final boolean segmentOptimizationEnabled
public Builder(String field, int maxMultiTermExpansions)
field - The query field.maxMultiTermExpansions - The maximum number of expansions across all multi-terms and across all segments.
It counts expansions for each segments individually, that allows optimizations per
segment and unused expansions are credited to next segments. This is different from
MultiPhraseQuery and SpanMultiTermQueryWrapper
which have an expansion limit per multi-term.public Builder(String field, int maxMultiTermExpansions, boolean segmentOptimizationEnabled)
field - The query field.maxMultiTermExpansions - The maximum number of expansions across all multi-terms and across all segments.
It counts expansions for each segments individually, that allows optimizations per
segment and unused expansions are credited to next segments. This is different from
MultiPhraseQuery and SpanMultiTermQueryWrapper
which have an expansion limit per multi-term.segmentOptimizationEnabled - Whether to enable the segment optimization which consists in ignoring a segment
for further analysis as soon as a term is not present inside it. This optimizes
the query execution performance but changes the scoring. The result ranking is
preserved.public PhraseWildcardQuery.Builder addTerm(BytesRef termBytes)
public PhraseWildcardQuery.Builder addTerm(Term term)
public PhraseWildcardQuery.Builder addMultiTerm(MultiTermQuery multiTermQuery)
MultiTermQuery enumeration
may match (expansion as a disjunction).public PhraseWildcardQuery.Builder setSlop(int slop)
public PhraseWildcardQuery build()
PhraseWildcardQuery.Copyright © 2022. All rights reserved.