Package com.yahoo.prelude.query.parser
Class AnyParser
java.lang.Object
com.yahoo.prelude.query.parser.AbstractParser
com.yahoo.prelude.query.parser.AnyParser
- All Implemented Interfaces:
CustomParser
,Parser
Parser for queries of type any.
- Author:
- Steinar Knutsen
-
Field Summary
Fields inherited from class com.yahoo.prelude.query.parser.AbstractParser
braceLevelURL, defaultIndex, environment, indexFacts, language, submodes, tokens
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Item
anyItems
(boolean topLevel) A collection of one or more items.protected Item
combineItems
(Item topLevelItem, Item item) Returns the top level item resulting from combining the given top level item and the new item.protected Item
protected Item
handleComposite
(boolean topLevel) Returns an item and whether it had an explicit index ('indexname:' prefix).protected Item
protected Item
protected Item
protected void
setSubmodeFromIndex
(String indexName, IndexFacts.Session indexFacts) Sets the submodes used for url parsing.protected Item
Returns a WordItem if this is a non CJK query, a WordItem or SegmentItem if this is a CJK query, null if the current item is not a wordMethods inherited from class com.yahoo.prelude.query.parser.AbstractParser
normalize, parse, parse, segment, setState, simplifyPhrases, tokenize
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.yahoo.prelude.query.parser.CustomParser
parse
-
Constructor Details
-
AnyParser
-
-
Method Details
-
parseItems
- Specified by:
parseItems
in classAbstractParser
-
negativeItem
-
combineItems
Returns the top level item resulting from combining the given top level item and the new item. This implements most of the weird transformation rules of the parser. -
handleComposite
-
anyItems
A collection of one or more items. More items are collected in the default composite - or. If there's a explicit composite and some other terms, a rank terms combines them -
positiveItem
-
compositeItem
-
setSubmodeFromIndex
Sets the submodes used for url parsing. Override this to influence when such submodes are used. -
indexableItem
Returns an item and whether it had an explicit index ('indexname:' prefix).- Returns:
- an item and whether it has an explicit index, or a Pair with the first element null if none
-
word
Returns a WordItem if this is a non CJK query, a WordItem or SegmentItem if this is a CJK query, null if the current item is not a word- Parameters:
quoted
- whether this token is inside quotes
-