Interface PhrasePredicateOptionsStep<S extends PhrasePredicateOptionsStep<?>>

  • Type Parameters:
    S - The "self" type (the actual exposed type of this step).
    All Superinterfaces:
    PredicateFinalStep, PredicateScoreStep<S>

    public interface PhrasePredicateOptionsStep<S extends PhrasePredicateOptionsStep<?>>
    extends PredicateFinalStep, PredicateScoreStep<S>
    The final step in a "phrase" predicate definition, where optional parameters can be set.
    • Method Detail

      • slop

        S slop​(int slop)
        Sets the slop, which defines how permissive the phrase predicate will be.

        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 <word> 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 value
        this, for method chaining.
      • analyzer

        S analyzer​(String analyzerName)
        Define an analyzer to use at query time to interpret the value to match.

        If this method is not called, the analyzer defined on the field will be used.

        analyzerName - The name of the analyzer to use in the query for this predicate.
        this, for method chaining.
      • skipAnalysis

        S skipAnalysis()
        Any analyzer or normalizer defined on any field will be ignored to interpret the value to match.
        this, for method chaining.