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
XSimpleQueryParser
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 ^nConstructor and Description |
---|
SimpleQueryStringParser(Settings settings) |
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
public String[] names()
QueryParser
names
in interface QueryParser
public org.apache.lucene.search.Query parse(QueryParseContext parseContext) throws IOException, QueryParsingException
QueryParser
parse
in interface QueryParser
IOException
QueryParsingException
Copyright © 2009–2015. All rights reserved.