public abstract class AbstractSearchQueryBuilder extends AbstractLoggableObject implements SearchQueryBuilder
SearchQueryBuilder
interface.Modifier and Type | Field and Description |
---|---|
private static CharFilter |
CHAR_FILTER_ACCEPT_UNTIL_END_OF_RANGE
The
CharFilter to match anything except the end of a range query. |
private static Set<String> |
RANGE_QUERY_SEPARATOR_SET
The separator of minimum and maximum in a range query.
|
Constructor and Description |
---|
AbstractSearchQueryBuilder()
The constructor.
|
Modifier and Type | Method and Description |
---|---|
protected SearchQuery |
createNullQuery()
This method creates (or gets) a query that matches anything.
|
private SearchQuery |
parseStandardClause(CharSequenceScanner parser,
String defaultField,
int depth,
SearchQueryBuilderOptions options) |
private SearchQuery |
parseStandardQuery(CharSequenceScanner parser,
SearchQueryBuilderOptions options,
String defaultProperty,
int depth) |
SearchQuery |
parseStandardQuery(String query)
This method parses the given
query string in the standard query language of this
specification. |
SearchQuery |
parseStandardQuery(String query,
SearchQueryBuilderOptions options)
This method parses the given
query string in the standard query language of this
specification. |
getLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createComplexQuery, createPhraseQuery, createRangeQuery, createWordQuery, refresh
private static final CharFilter CHAR_FILTER_ACCEPT_UNTIL_END_OF_RANGE
CharFilter
to match anything except the end of a range query.protected SearchQuery createNullQuery()
entry
.public SearchQuery parseStandardQuery(String query) throws SearchException
query
string in the standard query language of this
specification. parseStandardQuery
in interface SearchQueryBuilder
query
- is the query to parse as string.SearchException
- if the given query
string is illegal and can NOT be parsed.
Implementations should be tolerant and try to avoid this situation.SearchQueryBuilder.parseStandardQuery(String, SearchQueryBuilderOptions)
private SearchQuery parseStandardQuery(CharSequenceScanner parser, SearchQueryBuilderOptions options, String defaultProperty, int depth)
parser
- is the scanner of the query-string.options
- are the SearchQueryBuilderOptions
.defaultProperty
- is the property to use as default for unqualified search-terms.depth
- is the depth of the query expression (number of open parenthesis).null
if this a call with a depth greater than 0
and
the parsed query segment was void.parseStandardQuery(String, SearchQueryBuilderOptions)
private SearchQuery parseStandardClause(CharSequenceScanner parser, String defaultField, int depth, SearchQueryBuilderOptions options)
parser
- is the scanner of the query-string.defaultField
- is the field to use as default for unqualified search-terms.depth
- is the depth of the query expression (number of open parenthesis).options
- are the SearchQueryBuilderOptions
.null
if the parsed query segment was void.public SearchQuery parseStandardQuery(String query, SearchQueryBuilderOptions options)
query
string in the standard query language of this
specification. <WHITESPACE> = (' '|'\t'|'\n'|'\r') <WHITESPACES> = (<WHITESPACE>)+ <START_CHAR> = ^(<WHITESPACE>|'+'|'-'|'('|')'|'"'|'\'') <CHAR> = (<START_CHAR>|'+'|'-') <WORD
> = <START_CHAR> (<CHAR>)* <PHRASE
> = '"' (^('"'))* '"' <TO> = ("TO" | "to" | "-") <MIN> = <WORD> <MAX> = <WORD> <RANGE
> = ('{' | '[') <MIN> ' ' <TO> ' ' <MAX> (']' | '}') <MATCH> = (<PHRASE> | <WORD> | <RANGE>) <FIELD> = ('a'-'z'|'A'-'Z')+ <CLAUSE> = ['+'|'-'] [<FIELD> ':'] ( <MATCH> | '(' <QUERY> ')' ) <QUERY
> = <CLAUSE> | <CLAUSE> (<WHITESPACES> <QUERY>)* )
parseStandardQuery
in interface SearchQueryBuilder
query
- is the query to parse as string.options
- are the SearchQueryBuilderOptions
.Copyright © 2001–2016 mmm-Team. All rights reserved.