Class MatchQuery

  • Direct Known Subclasses:

    public class MatchQuery
    extends java.lang.Object
    • Field Detail


        public static final int DEFAULT_PHRASE_SLOP
        the default phrase slop
        See Also:
        Constant Field Values

        public static final boolean DEFAULT_LENIENCY
        the default leniency setting
        See Also:
        Constant Field Values

        public static final MatchQuery.ZeroTermsQuery DEFAULT_ZERO_TERMS_QUERY
        the default zero terms query
      • analyzer

        protected org.apache.lucene.analysis.Analyzer analyzer
      • occur

        protected occur
      • enablePositionIncrements

        protected boolean enablePositionIncrements
      • phraseSlop

        protected int phraseSlop
      • fuzzyPrefixLength

        protected int fuzzyPrefixLength
      • maxExpansions

        protected int maxExpansions
      • transpositions

        protected boolean transpositions
      • fuzzyRewriteMethod

        protected fuzzyRewriteMethod
      • lenient

        protected boolean lenient
      • commonTermsCutoff

        protected java.lang.Float commonTermsCutoff
      • autoGenerateSynonymsPhraseQuery

        protected boolean autoGenerateSynonymsPhraseQuery
    • Method Detail

      • setAnalyzer

        public void setAnalyzer​(java.lang.String analyzerName)
      • setAnalyzer

        public void setAnalyzer​(org.apache.lucene.analysis.Analyzer analyzer)
      • setOccur

        public void setOccur​( occur)
      • setCommonTermsCutoff

        public void setCommonTermsCutoff​(java.lang.Float cutoff)
      • setEnablePositionIncrements

        public void setEnablePositionIncrements​(boolean enablePositionIncrements)
      • setPhraseSlop

        public void setPhraseSlop​(int phraseSlop)
      • setFuzziness

        public void setFuzziness​(Fuzziness fuzziness)
      • setFuzzyPrefixLength

        public void setFuzzyPrefixLength​(int fuzzyPrefixLength)
      • setMaxExpansions

        public void setMaxExpansions​(int maxExpansions)
      • setTranspositions

        public void setTranspositions​(boolean transpositions)
      • setFuzzyRewriteMethod

        public void setFuzzyRewriteMethod​( fuzzyRewriteMethod)
      • setLenient

        public void setLenient​(boolean lenient)
      • setAutoGenerateSynonymsPhraseQuery

        public void setAutoGenerateSynonymsPhraseQuery​(boolean enabled)
      • getAnalyzer

        protected org.apache.lucene.analysis.Analyzer getAnalyzer​(MappedFieldType fieldType,
                                                                  boolean quoted)
      • parse

        public parse​(MatchQuery.Type type,
                                                    java.lang.String fieldName,
                                                    java.lang.Object value)
      • termQuery

        protected final termQuery​(MappedFieldType fieldType,
                                                                 org.apache.lucene.util.BytesRef value,
                                                                 boolean lenient)
      • zeroTermsQuery

        protected zeroTermsQuery()
      • blendPhraseQuery

        protected blendPhraseQuery​( query,
                                                                  MappedFieldType fieldType)
        Called when a phrase query is built with QueryBuilder.analyzePhrase(String, TokenStream, int). Subclass can override this function to blend this query to multiple fields.
      • blendTermsQuery

        protected blendTermsQuery​(org.apache.lucene.index.Term[] terms,
                                                                 MappedFieldType fieldType)
      • blendTermQuery

        protected blendTermQuery​(org.apache.lucene.index.Term term,
                                                                MappedFieldType fieldType)