public class SimpleQueryStringParser extends Object implements QueryParser
+' specifies AND operation: token1+token2
|' specifies OR operation: token1|token2
-' negates a single token: -token0
"' creates phrases of terms: "term1 term2 ..."
*' at the end of terms specifies prefix query: term*
(' and '' specifies precedence: token1 + (token2 | token3)
~N' at the end of terms specifies fuzzy query: term~1
~N' at the end of phrases specifies near/slop query: "term1 term2"~5
See: SimpleQueryParser for more information.
This query supports these options:
Required:
query - query text to be converted into other queries
Optional:
analyzer - anaylzer to be used for analyzing tokens to determine
which kind of query they should be converted into, defaults to "standard"
default_operator - default operator for boolean queries, defaults
to OR
fields - fields to search, defaults to _all if not set, allows
boosting a field with ^n
| Constructor and Description |
|---|
SimpleQueryStringParser() |
| Modifier and Type | Method and Description |
|---|---|
String[] |
names()
The names this query parser is registered under.
|
org.apache.lucene.search.Query |
parse(QueryParseContext parseContext)
Parses the into a query from the current parser location.
|
public static final String NAME
@Inject public SimpleQueryStringParser()
public String[] names()
QueryParsernames in interface QueryParserpublic org.apache.lucene.search.Query parse(QueryParseContext parseContext) throws IOException, QueryParsingException
QueryParserReturns null if this query should be ignored in the context of the DSL.
parse in interface QueryParserIOExceptionQueryParsingExceptionCopyright © 2009–2016. All rights reserved.