Package com.yahoo.prelude.query
Class WordItem
java.lang.Object
com.yahoo.prelude.query.Item
com.yahoo.prelude.query.SimpleTaggableItem
com.yahoo.prelude.query.SimpleIndexedItem
com.yahoo.prelude.query.TermItem
com.yahoo.prelude.query.WordItem
- All Implemented Interfaces:
BlockItem
,HasIndexItem
,IndexedItem
,TaggableItem
,Cloneable
- Direct Known Subclasses:
ExactStringItem
,MarkerWordItem
,PrefixItem
,SubstringItem
,SuffixItem
A simple word or token to match in some field.
- Author:
- bratseth, havardpe
-
Nested Class Summary
Nested classes/interfaces inherited from class com.yahoo.prelude.query.Item
Item.ItemCreator, Item.ItemType
-
Field Summary
Fields inherited from class com.yahoo.prelude.query.Item
connectedBacklink, connectedItem, connectivity, DEFAULT_WEIGHT, explicitSignificance, significance, uniqueID
-
Constructor Summary
ConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionprotected void
appendHeadingString
(StringBuilder buffer) Word items uses a empty heading instead of "WORD "void
protected void
encodeThis
(ByteBuffer buffer) boolean
Returns whether this item is of the same class and contains the same state as the given item.protected String
Returns the word for encoding.Return the searchable term contents of this item.Return the enumerated type of this item.getName()
Returns the name of this itemint
Returns how many phrase words does this item containGet the word exactly as received in the request.int
getWord()
Returns the same asstringValue()
int
hashCode()
boolean
boolean
boolean
boolean
isWords()
Returns true if this consists of regular word characters.void
setFromSegmented
(boolean fromSegmented) void
setLowercased
(boolean lowercased) void
setSegmentIndex
(int segmentIndex) void
setStemmed
(boolean stemmed) void
Same as #setWordvoid
void
setWords
(boolean words) Sets if this consists of regular word characters (true) or represents a "special token" (false)Returns this word as it should be used in executing the query.Methods inherited from class com.yahoo.prelude.query.TermItem
appendBodyString, encode, getOrigin, getSegmentingRule, getTermCount, isFromQuery, isNormalizable, setFromQuery, setNormalizable, setOrigin, setSegmentingRule
Methods inherited from class com.yahoo.prelude.query.SimpleIndexedItem
appendIndexString, getIndexName, setIndexName
Methods inherited from class com.yahoo.prelude.query.SimpleTaggableItem
getConnectedItem, getConnectivity, getSignificance, getUniqueID, hasExplicitSignificance, hasUniqueID, setConnectivity, setExplicitSignificance, setSignificance, setUniqueID
Methods inherited from class com.yahoo.prelude.query.Item
addAnnotation, clone, getAnnotation, getBytes, getCode, getCreator, getLabel, getLanguage, getParent, getWeight, hasAnnotation, hasConnectivityBackLink, isFilter, isFromSpecialToken, isProtected, isRanked, isRoot, putBytes, putString, setCreator, setFilter, setFromSpecialToken, setHasUniqueID, setLabel, setLanguage, setParent, setPositionData, setProtected, setRanked, setWeight, shouldParenthesize, toString, usePositionData
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.yahoo.prelude.query.HasIndexItem
getIndexName
-
Constructor Details
-
WordItem
-
WordItem
-
WordItem
-
WordItem
-
WordItem
-
WordItem
-
WordItem
-
-
Method Details
-
getItemType
Description copied from class:Item
Return the enumerated type of this item.- Specified by:
getItemType
in classItem
-
getName
Description copied from class:Item
Returns the name of this item -
setWord
-
encodeThis
- Overrides:
encodeThis
in classSimpleIndexedItem
-
getEncodedWord
Returns the word for encoding. By default simply the word -
getWord
Returns the same asstringValue()
-
stringValue
Returns this word as it should be used in executing the query. This is usually (but not always) a normalized and stemmed form -
setValue
Same as #setWord -
getRawWord
Get the word exactly as received in the request. This returns the same as getWord if no other raw form is known- Specified by:
getRawWord
in interfaceBlockItem
- Specified by:
getRawWord
in classTermItem
- Returns:
- the raw form of this word, never null
-
isStemmed
public boolean isStemmed() -
setStemmed
public void setStemmed(boolean stemmed) -
isFromSegmented
public boolean isFromSegmented() -
setFromSegmented
public void setFromSegmented(boolean fromSegmented) -
isLowercased
public boolean isLowercased() -
setLowercased
public void setLowercased(boolean lowercased) -
getSegmentIndex
public int getSegmentIndex() -
setSegmentIndex
public void setSegmentIndex(int segmentIndex) -
appendHeadingString
Word items uses a empty heading instead of "WORD "- Overrides:
appendHeadingString
in classItem
-
equals
Description copied from class:Item
Returns whether this item is of the same class and contains the same state as the given item. -
hashCode
public int hashCode() -
getNumWords
public int getNumWords()Description copied from interface:HasIndexItem
Returns how many phrase words does this item contain -
getIndexedString
Description copied from interface:IndexedItem
Return the searchable term contents of this item.- Specified by:
getIndexedString
in interfaceIndexedItem
- Specified by:
getIndexedString
in classSimpleIndexedItem
- Returns:
- a string representation of what is presumably stored in an index which will match this item
-
isWords
public boolean isWords()Returns true if this consists of regular word characters. Returns false if this represents a "special token" -
setWords
public void setWords(boolean words) Sets if this consists of regular word characters (true) or represents a "special token" (false) -
disclose
-