Class SimpleQueryStringQueryParser

java.lang.Object
org.apache.lucene.util.QueryBuilder
org.apache.lucene.queryparser.simple.SimpleQueryParser
org.elasticsearch.index.search.SimpleQueryStringQueryParser

public class SimpleQueryStringQueryParser extends org.apache.lucene.queryparser.simple.SimpleQueryParser
Wrapper class for Lucene's SimpleQueryStringQueryParser that allows us to redefine different types of queries.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Class encapsulating the settings for the SimpleQueryString query, with their default values

    Nested classes/interfaces inherited from class org.apache.lucene.util.QueryBuilder

    org.apache.lucene.util.QueryBuilder.TermAndBoost
  • Field Summary

    Fields inherited from class org.apache.lucene.queryparser.simple.SimpleQueryParser

    AND_OPERATOR, ESCAPE_OPERATOR, flags, FUZZY_OPERATOR, NEAR_OPERATOR, NOT_OPERATOR, OR_OPERATOR, PHRASE_OPERATOR, PRECEDENCE_OPERATORS, PREFIX_OPERATOR, weights, WHITESPACE_OPERATOR

    Fields inherited from class org.apache.lucene.util.QueryBuilder

    analyzer, autoGenerateMultiTermSynonymsPhraseQuery, enableGraphQueries, enablePositionIncrements
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new parser with custom flags used to enable/disable certain features.
    SimpleQueryStringQueryParser(org.apache.lucene.analysis.Analyzer analyzer, Map<String,Float> weights, int flags, SimpleQueryStringQueryParser.Settings settings, SearchExecutionContext context)
    Creates a new parser with custom flags used to enable/disable certain features.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.lucene.search.Query
     
    org.apache.lucene.search.Query
    newFuzzyQuery(String text, int fuzziness)
     
    org.apache.lucene.search.Query
    newPhraseQuery(String text, int slop)
     
    org.apache.lucene.search.Query
     
    protected org.apache.lucene.search.Query
    newTermQuery(org.apache.lucene.index.Term term, float boost)
     
    void
    setDefaultOperator(org.apache.lucene.search.BooleanClause.Occur operator)
     

    Methods inherited from class org.apache.lucene.queryparser.simple.SimpleQueryParser

    getDefaultOperator, parse, simplify

    Methods inherited from class org.apache.lucene.util.QueryBuilder

    add, analyzeBoolean, analyzeGraphBoolean, analyzeGraphPhrase, analyzeMultiBoolean, analyzeMultiPhrase, analyzePhrase, analyzeTerm, createBooleanQuery, createBooleanQuery, createFieldQuery, createFieldQuery, createMinShouldMatchQuery, createPhraseQuery, createPhraseQuery, createSpanQuery, getAnalyzer, getAutoGenerateMultiTermSynonymsPhraseQuery, getEnableGraphQueries, getEnablePositionIncrements, newBooleanQuery, newGraphSynonymQuery, newMultiPhraseQueryBuilder, newSynonymQuery, setAnalyzer, setAutoGenerateMultiTermSynonymsPhraseQuery, setEnableGraphQueries, setEnablePositionIncrements

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • setDefaultOperator

      public void setDefaultOperator(org.apache.lucene.search.BooleanClause.Occur operator)
      Overrides:
      setDefaultOperator in class org.apache.lucene.queryparser.simple.SimpleQueryParser
    • newTermQuery

      protected org.apache.lucene.search.Query newTermQuery(org.apache.lucene.index.Term term, float boost)
      Overrides:
      newTermQuery in class org.apache.lucene.util.QueryBuilder
    • newDefaultQuery

      public org.apache.lucene.search.Query newDefaultQuery(String text)
      Overrides:
      newDefaultQuery in class org.apache.lucene.queryparser.simple.SimpleQueryParser
    • newFuzzyQuery

      public org.apache.lucene.search.Query newFuzzyQuery(String text, int fuzziness)
      Overrides:
      newFuzzyQuery in class org.apache.lucene.queryparser.simple.SimpleQueryParser
    • newPhraseQuery

      public org.apache.lucene.search.Query newPhraseQuery(String text, int slop)
      Overrides:
      newPhraseQuery in class org.apache.lucene.queryparser.simple.SimpleQueryParser
    • newPrefixQuery

      public org.apache.lucene.search.Query newPrefixQuery(String text)
      Overrides:
      newPrefixQuery in class org.apache.lucene.queryparser.simple.SimpleQueryParser