public class SearchTokenizer extends Object
searchExpr = ( OPEN BWS searchExpr BWS CLOSE / searchTerm )
[ searchOrExpr / searchAndExpr ]
searchOrExpr = RWS 'OR' RWS searchExpr
searchAndExpr = RWS [ 'AND' RWS ] searchExpr
searchTerm = [ 'NOT' RWS ] ( searchPhrase / searchWord )
searchPhrase = quotation-mark 1*qchar-no-AMP-DQUOTE quotation-mark
searchWord = 1*ALPHA ; Actually: any character from the Unicode categories L or Nl,
but not the words AND, OR, and NOT
ATTENTION: This class does not support a percent-encoded
searchPhrase because the URI parser percent decodes
each query before calling parsers of query options.| Constructor and Description |
|---|
SearchTokenizer() |
| Modifier and Type | Method and Description |
|---|---|
List<SearchQueryToken> |
tokenize(String searchQuery)
Takes the search query and splits it into a list of corresponding
SearchQueryTokens. |
public List<SearchQueryToken> tokenize(String searchQuery)
SearchQueryTokens. Before splitting it into tokens, leading and
trailing whitespace in the given search query string is removed.searchQuery - search query to be tokenizedCopyright © 2021. All rights reserved.