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, documentFrequency, explicitSignificance, significance, uniqueID -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionprotected voidappendHeadingString(StringBuilder buffer) Word items uses a empty heading instead of "WORD "voidprotected voidencodeThis(ByteBuffer buffer) booleanReturns whether this item is of the same class and contains the same state as the given item.protected StringReturns 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 itemintReturns how many phrase words does this item containGet the word exactly as received in the request.intgetWord()Returns the same asstringValue()inthashCode()booleanbooleanbooleanisWords()Returns true if this consists of regular word characters.voidsetFromSegmented(boolean fromSegmented) voidsetSegmentIndex(int segmentIndex) voidsetStemmed(boolean stemmed) voidSame as #setWordvoidvoidsetWords(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, isLowercased, isNormalizable, setFromQuery, setLowercased, setNormalizable, setOrigin, setSegmentingRuleMethods inherited from class com.yahoo.prelude.query.SimpleIndexedItem
appendIndexString, getFieldName, getIndexName, setIndexNameMethods inherited from class com.yahoo.prelude.query.SimpleTaggableItem
getConnectedItem, getConnectivity, getDocumentFrequency, getSignificance, getUniqueID, hasExplicitSignificance, hasUniqueID, setConnectivity, setDocumentFrequency, setExplicitSignificance, setSignificance, setUniqueIDMethods inherited from class com.yahoo.prelude.query.Item
addAnnotation, clone, getAnnotation, getBytes, getCode, getCreator, getLabel, getLanguage, getParent, getWeight, hasAnnotation, hasConnectivityBackLink, hasPrefixMatchSemantics, isFilter, isFromSpecialToken, isProtected, isRanked, isRoot, putBytes, putString, setCreator, setFilter, setFromSpecialToken, setHasUniqueID, setLabel, setLanguage, setParent, setPositionData, setProtected, setRanked, setWeight, shouldParenthesize, toString, usePositionDataMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:ItemReturn the enumerated type of this item.- Specified by:
getItemTypein classItem
-
getName
Description copied from class:ItemReturns the name of this item -
setWord
-
encodeThis
- Overrides:
encodeThisin 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:
getRawWordin interfaceBlockItem- Specified by:
getRawWordin 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) -
getSegmentIndex
public int getSegmentIndex() -
setSegmentIndex
public void setSegmentIndex(int segmentIndex) -
appendHeadingString
Word items uses a empty heading instead of "WORD "- Overrides:
appendHeadingStringin classItem
-
equals
Description copied from class:ItemReturns 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:HasIndexItemReturns how many phrase words does this item contain -
getIndexedString
Description copied from interface:IndexedItemReturn the searchable term contents of this item.- Specified by:
getIndexedStringin interfaceIndexedItem- Specified by:
getIndexedStringin 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
-