Package com.yahoo.prelude.query.parser
Class WebParser
- java.lang.Object
-
- com.yahoo.prelude.query.parser.AbstractParser
-
- com.yahoo.prelude.query.parser.AllParser
-
- com.yahoo.prelude.query.parser.WebParser
-
- All Implemented Interfaces:
CustomParser
,Parser
public class WebParser extends AllParser
Parser for web search queries. Language:- +item: always include this item as-is when searching (term becomes protected)
- -item: Exclude item when searching (terms becomes protected)
- a OR b (capital or): Or search for a or b
- "a b": Phrase search for a followed by b
- Author:
- bratseth
-
-
Field Summary
-
Fields inherited from class com.yahoo.prelude.query.parser.AbstractParser
braceLevelURL, environment, indexFacts, language, submodes, tokens
-
-
Constructor Summary
Constructors Constructor Description WebParser(ParserEnvironment environment)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Item
anyItems(boolean topLevel)
A collection of one or more items.protected Item
compositeItem()
protected Item
handleComposite(boolean topLevel)
protected Item
indexableItem()
protected Item
parseItemsBody()
protected Item
positiveItem()
protected void
setSubmodeFromIndex(java.lang.String indexName, IndexFacts.Session indexFacts)
Sets the submodes used for url parsing.protected void
setSubmodeFromIndex(java.lang.String indexName, java.util.Set<java.lang.String> searchDefinitions)
-
Methods inherited from class com.yahoo.prelude.query.parser.AllParser
addAnd, addNot, addOr, combineItems, negativeItem, parseItems, simplifyUnnecessaryComposites
-
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
-
WebParser
public WebParser(ParserEnvironment environment)
-
-
Method Detail
-
parseItemsBody
protected Item parseItemsBody()
- Overrides:
parseItemsBody
in classAllParser
-
setSubmodeFromIndex
protected void setSubmodeFromIndex(java.lang.String indexName, java.util.Set<java.lang.String> searchDefinitions)
-
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(java.lang.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()
-
-