Package org.elasticsearch.index.search
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
Modifier and TypeClassDescriptionstatic class
Class encapsulating the settings for the SimpleQueryString query, with their default valuesNested 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
ConstructorDescriptionSimpleQueryStringQueryParser(Map<String,Float> weights, int flags, SimpleQueryStringQueryParser.Settings settings, SearchExecutionContext context)
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 TypeMethodDescriptionorg.apache.lucene.search.Query
newDefaultQuery(String text)
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
newPrefixQuery(String text)
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
-
Constructor Details
-
SimpleQueryStringQueryParser
public SimpleQueryStringQueryParser(Map<String,Float> weights, int flags, SimpleQueryStringQueryParser.Settings settings, SearchExecutionContext context)Creates a new parser with custom flags used to enable/disable certain features. -
SimpleQueryStringQueryParser
public 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 Details
-
setDefaultOperator
public void setDefaultOperator(org.apache.lucene.search.BooleanClause.Occur operator)- Overrides:
setDefaultOperator
in classorg.apache.lucene.queryparser.simple.SimpleQueryParser
-
newTermQuery
protected org.apache.lucene.search.Query newTermQuery(org.apache.lucene.index.Term term, float boost)- Overrides:
newTermQuery
in classorg.apache.lucene.util.QueryBuilder
-
newDefaultQuery
- Overrides:
newDefaultQuery
in classorg.apache.lucene.queryparser.simple.SimpleQueryParser
-
newFuzzyQuery
- Overrides:
newFuzzyQuery
in classorg.apache.lucene.queryparser.simple.SimpleQueryParser
-
newPhraseQuery
- Overrides:
newPhraseQuery
in classorg.apache.lucene.queryparser.simple.SimpleQueryParser
-
newPrefixQuery
- Overrides:
newPrefixQuery
in classorg.apache.lucene.queryparser.simple.SimpleQueryParser
-