Package com.yahoo.prelude.query
Class WandItem
java.lang.Object
com.yahoo.prelude.query.Item
com.yahoo.prelude.query.SimpleTaggableItem
com.yahoo.prelude.query.WeightedSetItem
com.yahoo.prelude.query.WandItem
- All Implemented Interfaces:
TaggableItem,Cloneable
A weighted set query item to be evaluated as a Wand with dot product scoring.
The dot product is calculated between the matched tokens of the weighted set field searched
and the weights associated with the tokens of this WandItem.
The resulting dot product will be available as a raw score in the rank framework.
- Author:
- geirst
-
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 voidappendHeadingString(StringBuilder buffer) Appends the heading of this string.voidprotected voidencodeThis(ByteBuffer buffer) booleanReturns whether this item is of the same class and contains the same state as the given item.Return the enumerated type of this item.doubleintdoubleinthashCode()voidsetScoreThreshold(double scoreThreshold) Sets the initial score threshold used by the backend search operator handling this WandItem.voidsetThresholdBoostFactor(double thresholdBoostFactor) Sets the boost factor used by the backend search operator to boost the threshold before comparing it with the upper bound score of the document being evaluated.Methods inherited from class com.yahoo.prelude.query.WeightedSetItem
addToken, addToken, addToken, appendBodyString, clone, encode, getIndexName, getName, getNumTokens, getTermCount, getTokens, getTokenWeight, hasOnlyLongs, removeToken, 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, 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, usePositionData
-
Constructor Details
-
WandItem
Creates an empty WandItem.- Parameters:
fieldName- the name of the weighted set field to search with this WandItem.targetNumHits- the target for minimum number of hits to produce by the backend search operator handling this WandItem.
-
WandItem
Creates an empty WandItem.- Parameters:
fieldName- the name of the weighted set field to search with this WandItem.targetNumHits- the target for minimum number of hits to produce by the backend search operator handling this WandItem.tokens- the tokens to search for
-
-
Method Details
-
setScoreThreshold
public void setScoreThreshold(double scoreThreshold) Sets the initial score threshold used by the backend search operator handling this WandItem. The score of a document must be larger than this threshold in order to be considered a match. Default value is 0.0.- Parameters:
scoreThreshold- the initial score threshold.
-
setThresholdBoostFactor
public void setThresholdBoostFactor(double thresholdBoostFactor) Sets the boost factor used by the backend search operator to boost the threshold before comparing it with the upper bound score of the document being evaluated. A large value of this factor results in fewer full evaluations and in an expected loss in precision. Similarly, a gain in performance might be expected. Default value is 1.0. NOTE: This boost factor is only used when this WandItem is searching a Vespa field.- Parameters:
thresholdBoostFactor- the boost factor.
-
getTargetNumHits
public int getTargetNumHits() -
getScoreThreshold
public double getScoreThreshold() -
getThresholdBoostFactor
public double getThresholdBoostFactor() -
getItemType
Description copied from class:ItemReturn the enumerated type of this item.- Overrides:
getItemTypein classWeightedSetItem
-
encodeThis
- Overrides:
encodeThisin classWeightedSetItem
-
appendHeadingString
Description copied from class:ItemAppends the heading of this string. As default getName() followed by a space.- Overrides:
appendHeadingStringin classItem
-
disclose
- Overrides:
disclosein classWeightedSetItem
-
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 classWeightedSetItem
-
hashCode
public int hashCode()- Overrides:
hashCodein classWeightedSetItem
-