Package com.yahoo.prelude.query
Class FuzzyItem
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.FuzzyItem
- All Implemented Interfaces:
BlockItem,HasIndexItem,IndexedItem,TaggableItem,Cloneable
Fuzzy search term
- Author:
- alexeyche
-
Nested Class Summary
Nested classes/interfaces inherited from class com.yahoo.prelude.query.Item
Item.ItemCreator, Item.ItemType -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intstatic intFields 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 voidappendHeadingString(StringBuilder buffer) Appends the heading of this string.protected voidencodeThis(ByteBuffer buffer) booleanReturns whether this item is of the same class and contains the same state as the given item.Return the searchable term contents of this item.Return the enumerated type of this item.intgetName()Returns the name of this itemintReturns how many phrase words does this item containintReturns the raw form of the text leading to this term, exactly as received, including original casinginthashCode()protected booleanIndicates that a query item that does not normally match with prefix semantics should do so for this particular query item instance.booleanbooleanbooleanisWords()Returns whether this item represents normal textvoidsetMaxEditDistance(int maxEditDistance) voidsetPrefixLength(int prefixLength) voidsetPrefixMatch(boolean prefixMatch) voidSets the value of this item from a string.Returns the value of this term as a stringMethods inherited from class com.yahoo.prelude.query.TermItem
appendBodyString, disclose, 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, 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
-
Field Details
-
DEFAULT_MAX_EDIT_DISTANCE
public static int DEFAULT_MAX_EDIT_DISTANCE -
DEFAULT_PREFIX_LENGTH
public static int DEFAULT_PREFIX_LENGTH
-
-
Constructor Details
-
FuzzyItem
-
FuzzyItem
-
-
Method Details
-
setMaxEditDistance
public void setMaxEditDistance(int maxEditDistance) -
setPrefixLength
public void setPrefixLength(int prefixLength) -
getPrefixLength
public int getPrefixLength() -
getMaxEditDistance
public int getMaxEditDistance() -
isPrefixMatch
public boolean isPrefixMatch() -
setPrefixMatch
public void setPrefixMatch(boolean prefixMatch) -
hasPrefixMatchSemantics
protected boolean hasPrefixMatchSemantics()Description copied from class:ItemIndicates that a query item that does not normally match with prefix semantics should do so for this particular query item instance. False by default; should be overridden by subclasses that want to signal this behavior.- Overrides:
hasPrefixMatchSemanticsin classItem
-
setValue
Description copied from class:TermItemSets the value of this item from a string. -
getRawWord
Description copied from class:TermItemReturns the raw form of the text leading to this term, exactly as received, including original casing- Specified by:
getRawWordin interfaceBlockItem- Specified by:
getRawWordin classTermItem
-
isWords
public boolean isWords()Description copied from interface:BlockItemReturns whether this item represents normal text -
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 -
stringValue
Description copied from interface:BlockItemReturns the value of this term as a string -
isStemmed
public boolean isStemmed() -
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
-
getNumWords
public int getNumWords()Description copied from interface:HasIndexItemReturns how many phrase words does this item contain -
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() -
appendHeadingString
Description copied from class:ItemAppends the heading of this string. As default getName() followed by a space.- Overrides:
appendHeadingStringin classItem
-
encodeThis
- Overrides:
encodeThisin classSimpleIndexedItem
-