public interface PhrasePredicateTerminalContext extends SearchPredicateTerminalContext, SearchPredicateScoreContext<PhrasePredicateTerminalContext>
Allows to set options or to retrieve the predicate.
| Modifier and Type | Method and Description |
|---|---|
PhrasePredicateTerminalContext |
withSlop(int slop)
Sets the slop, which defines how permissive the phrase predicate will be.
|
toPredicatewithConstantScoreboostedToPhrasePredicateTerminalContext withSlop(int slop)
If zero (the default), then the predicate will only match the exact phrase given (after analysis). Higher values are increasingly permissive, allowing unexpected words or words that switched position.
The slop represents the number of edit operations that can be applied to the phrase to match,
where each edit operation moves one word by one position.
So quick fox with a slop of 1 can become quick * fox, where <word> can be any word.
quick fox with a slop of 2 can become quick <word> fox, or quick <word1> <word2> fox
or even fox quick (two operations: moved fox to the left and quick to the right).
And similarly for higher slops and for phrases with more words.
slop - The slop valuethis, for method chaining.Copyright © 2006-2019 Red Hat, Inc. and others. Licensed under the GNU Lesser General Public License (LGPL), version 2.1 or later.