Class MultiPhraseQuery.Builder

  • Enclosing class:
    MultiPhraseQuery

    public static class MultiPhraseQuery.Builder
    extends Object
    A builder for multi-phrase queries
    • Constructor Detail

      • Builder

        public Builder()
        Default constructor.
      • Builder

        public Builder​(MultiPhraseQuery multiPhraseQuery)
        Copy constructor: this will create a builder that has the same configuration as the provided builder.
    • Method Detail

      • add

        public MultiPhraseQuery.Builder add​(Term[] terms)
        Add multiple terms at the next position in the phrase. Any of the terms may match (a disjunction). The array is not copied or mutated, the caller should consider it immutable subsequent to calling this method.
      • add

        public MultiPhraseQuery.Builder add​(Term[] terms,
                                            int position)
        Allows to specify the relative position of terms within the phrase. The array is not copied or mutated, the caller should consider it immutable subsequent to calling this method.