Package com.yahoo.prelude.query
Class TermItem
java.lang.Object
com.yahoo.prelude.query.Item
com.yahoo.prelude.query.SimpleTaggableItem
com.yahoo.prelude.query.SimpleIndexedItem
com.yahoo.prelude.query.TermItem
- All Implemented Interfaces:
BlockItem,HasIndexItem,IndexedItem,TaggableItem,Cloneable
- Direct Known Subclasses:
BoolItem,FuzzyItem,GeoLocationItem,IntItem,RegExpItem,WordAlternativesItem,WordItem
Superclass of "leaf" conditions containing a single entity which is either matched in a field or not.
- 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidappendBodyString(StringBuilder buffer) Appends the index prefix if necessary and delegates to the subclassvoidfinal intencode(ByteBuffer buffer) booleanReturns whether this item is of the same class and contains the same state as the given item.Returns the substring which is the raw form of the text leading to this token.abstract StringReturns the raw form of the text leading to this term, exactly as received, including original casingIf the block has to be resegmented, what operator should be chosen if it is necessary to change operator?intinthashCode()booleanWhether this term is from the query or has been added by a searcher.booleanbooleanReturns whether accent removal is a meaningful and possible operation for this word.abstract booleanisWords()Returns whether this item represents normal textvoidsetFromQuery(boolean isFromQuery) voidsetLowercased(boolean lowercased) voidsetNormalizable(boolean normalizable) Sets whether accent removal is a meaningful and possible operation for this word.voidSets the origin of thisvoidsetSegmentingRule(SegmentingRule segmentingRule) abstract voidSets the value of this item from a string.Methods inherited from class com.yahoo.prelude.query.SimpleIndexedItem
appendIndexString, encodeThis, getFieldName, getIndexedString, 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, appendHeadingString, clone, getAnnotation, getBytes, getCode, getCreator, getItemType, getLabel, getLanguage, getName, 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.BlockItem
isStemmed, stringValueMethods inherited from interface com.yahoo.prelude.query.HasIndexItem
getIndexName, getNumWords
-
Constructor Details
-
TermItem
public TermItem() -
TermItem
-
TermItem
-
TermItem
-
-
Method Details
-
encode
-
appendBodyString
Appends the index prefix if necessary and delegates to the subclass- Specified by:
appendBodyStringin classItem
-
setValue
Sets the value of this item from a string.- Throws:
UnsupportedOperationException- if this is not supported on this kind of item
-
getRawWord
Returns the raw form of the text leading to this term, exactly as received, including original casing- Specified by:
getRawWordin interfaceBlockItem
-
getOrigin
Returns the substring which is the raw form of the text leading to this token. This substring also contains the superstring this substring was a part of, e.g the whole query string. If this did not originate directly from a user string, this is null. -
isFromQuery
public boolean isFromQuery()Whether this term is from the query or has been added by a searcher. Only terms from the user should be modified by query rewriters which attempts to improve the precision or recall of the user's query.- Specified by:
isFromQueryin interfaceBlockItem
-
setFromQuery
public void setFromQuery(boolean isFromQuery) -
isWords
public abstract boolean isWords()Description copied from interface:BlockItemReturns whether this item represents normal text -
setOrigin
Sets the origin of this -
disclose
- Overrides:
disclosein classSimpleIndexedItem
-
getTermCount
public int getTermCount()- Specified by:
getTermCountin classItem
-
isNormalizable
public boolean isNormalizable()Returns whether accent removal is a meaningful and possible operation for this word. -
setNormalizable
public void setNormalizable(boolean normalizable) Sets whether accent removal is a meaningful and possible operation for this word.- Parameters:
normalizable- set to true if accent removal can/should be performed
-
isLowercased
public boolean isLowercased() -
setLowercased
public void setLowercased(boolean lowercased) -
getSegmentingRule
Description copied from interface:BlockItemIf the block has to be resegmented, what operator should be chosen if it is necessary to change operator?- Specified by:
getSegmentingRulein interfaceBlockItem
-
setSegmentingRule
-
equals
Description copied from class:ItemReturns whether this item is of the same class and contains the same state as the given item.- Overrides:
equalsin classSimpleIndexedItem
-
hashCode
public int hashCode()- Overrides:
hashCodein classSimpleIndexedItem
-