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
Modifier and TypeFieldDescriptionstatic final int
The default distance used if none is specified: 2protected int
Fields inherited from class com.yahoo.prelude.query.Item
connectedBacklink, connectedItem, connectivity, DEFAULT_WEIGHT, explicitSignificance, significance, uniqueID
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
appendHeadingString
(StringBuilder buffer) Appends the heading of this string -[getName()]([limit])
void
protected void
encodeThis
(ByteBuffer buffer) Encodes just this item, not its regular subitems, to the given buffer.boolean
Returns whether this item is of the same class and contains the same state as the given item.int
Return the enumerated type of this item.getName()
Returns the name of this itemint
hashCode()
void
setDistance
(int distance) 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, shouldParenthesize
Methods inherited from class com.yahoo.prelude.query.Item
addAnnotation, getAnnotation, getBytes, getCode, getCreator, getLabel, getLanguage, getParent, getWeight, hasAnnotation, hasConnectivityBackLink, 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 -
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() -
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 -
encodeThis
Description copied from class:CompositeItem
Encodes just this item, not its regular subitems, to the given buffer.- Overrides:
encodeThis
in classCompositeItem
-
disclose
- Overrides:
disclose
in classCompositeItem
-
appendHeadingString
Appends the heading of this string -[getName()]([limit])
- Overrides:
appendHeadingString
in classItem
-
equals
Description copied from class:CompositeItem
Returns whether this item is of the same class and contains the same state as the given item.- Overrides:
equals
in classCompositeItem
-
hashCode
public int hashCode()- Overrides:
hashCode
in classCompositeItem
-