Package com.yahoo.prelude.query
Class NearItem
java.lang.Object
com.yahoo.prelude.query.Item
com.yahoo.prelude.query.CompositeItem
com.yahoo.prelude.query.NearItem
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
ONearItem
A set of terms which must be near each other to match.
- Author:
- bratseth, havardpe
-
Nested Class Summary
Nested classes/interfaces inherited from class com.yahoo.prelude.query.Item
Item.ItemCreator, Item.ItemType -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe default distance used if none is specified: 2protected intprotected intprotected 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 -[getName()]([limit])voidprotected voidencodeThis(ByteBuffer buffer) Encodes just this item, not its regular subitems, to the given buffer.booleanReturns whether this item is of the same class and contains the same state as the given item.intintReturn the enumerated type of this item.getName()Returns the name of this itemintinthashCode()voidsetDistance(int distance) voidsetExclusionDistance(int exclusionDistance) voidsetNumNegativeItems(int numNegativeItems) Methods inherited from class com.yahoo.prelude.query.CompositeItem
acceptsItemsOfType, adding, addItem, addItem, appendBodyString, clone, encode, encodingArity, ensureNotInSubtree, extractSingleChild, getItem, getItemCount, getItemIndex, getItemIterator, getTermCount, isLocked, items, lock, removeItem, removeItem, setIndexName, setItem, shouldParenthesizeMethods inherited from class com.yahoo.prelude.query.Item
addAnnotation, getAnnotation, getBytes, getCode, getCreator, getLabel, getLanguage, getParent, getWeight, hasAnnotation, hasConnectivityBackLink, hasPrefixMatchSemantics, hasUniqueID, isFilter, isFromSpecialToken, isProtected, isRanked, isRoot, putBytes, putString, setCreator, setFilter, setFromSpecialToken, setHasUniqueID, setLabel, setLanguage, setParent, setPositionData, setProtected, setRanked, setWeight, toString, usePositionData
-
Field Details
-
distance
protected int distance -
numNegativeItems
protected int numNegativeItems -
exclusionDistance
protected int exclusionDistance -
defaultDistance
public static final int defaultDistanceThe default distance used if none is specified: 2- See Also:
-
-
Constructor Details
-
NearItem
public NearItem()Creates a NEAR item with distance 2 -
NearItem
public NearItem(int distance) Creates a near item with a limit to the distance between the words.- Parameters:
distance- the maximum position difference between the words which should be counted as a match
-
-
Method Details
-
setDistance
public void setDistance(int distance) -
getDistance
public int getDistance() -
setNumNegativeItems
public void setNumNegativeItems(int numNegativeItems) -
getNumNegativeItems
public int getNumNegativeItems() -
setExclusionDistance
public void setExclusionDistance(int exclusionDistance) -
getExclusionDistance
public int getExclusionDistance() -
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 -
encodeThis
Description copied from class:CompositeItemEncodes just this item, not its regular subitems, to the given buffer.- Overrides:
encodeThisin classCompositeItem
-
disclose
- Overrides:
disclosein classCompositeItem
-
appendHeadingString
Appends the heading of this string -[getName()]([limit])- Overrides:
appendHeadingStringin classItem
-
equals
Description copied from class:CompositeItemReturns whether this item is of the same class and contains the same state as the given item.- Overrides:
equalsin classCompositeItem
-
hashCode
public int hashCode()- Overrides:
hashCodein classCompositeItem
-