Package com.yahoo.prelude.query.parser
Class AllParser
- java.lang.Object
-
- com.yahoo.prelude.query.parser.AbstractParser
-
- com.yahoo.prelude.query.parser.AllParser
-
- All Implemented Interfaces:
CustomParser
,Parser
- Direct Known Subclasses:
WebParser
public class AllParser extends AbstractParser
Parser for queries of type all.- Author:
- Steinar Knutsen, bratseth
-
-
Field Summary
-
Fields inherited from class com.yahoo.prelude.query.parser.AbstractParser
braceLevelURL, environment, indexFacts, language, submodes, tokens
-
-
Constructor Summary
Constructors Constructor Description AllParser(ParserEnvironment environment, boolean weakAnd)
Creates an And parser
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CompositeItem
addAnd(Item item, CompositeItem and)
protected NotItem
addNot(Item item, NotItem not)
protected OrItem
addOr(Item item, OrItem or)
protected 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
compositeItem()
protected Item
handleComposite(boolean topLevel)
protected Item
indexableItem()
protected Item
negativeItem()
protected Item
parseItems()
protected Item
parseItemsBody()
protected Item
positiveItem()
protected void
setSubmodeFromIndex(String indexName, IndexFacts.Session indexFacts)
Sets the submodes used for url parsing.protected Item
simplifyUnnecessaryComposites(Item item)
protected Item
word(String indexName, boolean quoted)
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-
Methods 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 Detail
-
AllParser
public AllParser(ParserEnvironment environment, boolean weakAnd)
Creates an And parser- Parameters:
weakAnd
- false to parse into AndItem (by default), true to parse to WeakAnd
-
-
Method Detail
-
parseItems
protected Item parseItems()
- Specified by:
parseItems
in classAbstractParser
-
parseItemsBody
protected Item parseItemsBody()
-
addAnd
protected CompositeItem addAnd(Item item, CompositeItem and)
-
negativeItem
protected Item negativeItem()
-
combineItems
protected Item combineItems(Item topLevelItem, Item item)
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
protected Item handleComposite(boolean topLevel)
-
anyItems
protected Item anyItems(boolean topLevel)
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
protected Item positiveItem()
-
compositeItem
protected Item compositeItem()
-
setSubmodeFromIndex
protected void setSubmodeFromIndex(String indexName, IndexFacts.Session indexFacts)
Sets the submodes used for url parsing. Override this to influence when such submodes are used.
-
indexableItem
protected Item indexableItem()
-
-