- All Implemented Interfaces:
- Direct Known Subclasses:
public abstract class SimpleTaggableItem extends Item implements TaggableItemCommon implementation for Item classes implementing the TaggableItem interface. Note that this file exist in 3 copies that should be kept in sync: CompositeTaggableItem.java SimpleTaggableItem.java TaggableSegmentItem.java These should only have trivial differences. (multiple inheritance or mixins would have been nice).
Constructors Constructor Description
All Methods Instance Methods Concrete Methods Modifier and Type Method Description
setConnectivity(Item item, double connectivity)Set the connectivity to another term in the same query tree.
setSignificance(double significance)Used for setting explicit term significance (in the tf/idf sense) to a single term or phrase, relative to the rest of the query.
Methods inherited from class com.yahoo.prelude.query.Item
addAnnotation, appendBodyString, appendHeadingString, clone, disclose, encode, encodeThis, equals, getAnnotation, getBytes, getCode, getCreator, getItemType, getLabel, getLanguage, getName, getParent, getTermCount, getWeight, hasAnnotation, hasConnectivityBackLink, hashCode, isFilter, isFromSpecialToken, isProtected, isRanked, isRoot, putBytes, putString, setCreator, setFilter, setFromSpecialToken, setHasUniqueID, setIndexName, setLabel, setLanguage, setParent, setPositionData, setProtected, setRanked, setWeight, shouldParenthize, toString, usePositionData
public void setConnectivity(Item item, double connectivity)Description copied from interface:
TaggableItemSet the connectivity to another term in the same query tree. This is used to influence ranking features taking proximity into account: nativeRank and a subset of the fieldMatch features.
By default consecutive query terms are 'somewhat' connected, meaning ranking features will be better in documents where the terms are found close to each other. This effect can be increased or decreased by manipulating the connectivity value. Typical use is to increase the connectivity between terms in the query that we believe are semantically connected. E.g in the query 'new york hotel', it is a good idea to increase the connectivity between "new" and "york" to ensure that a document containing "List of hotels in New York" is ranked above one containing "List of new hotels in York".
- Specified by:
item- the item this should be connected to - in practice the next consecutive item in the query
connectivity- a value between 0 (none) and 1 (maximal), defining the connectivity between this and the argument item. The default connectivity is 0.1.
public Item getConnectedItem()
public double getConnectivity()
public void setSignificance(double significance)Description copied from interface:
TaggableItemUsed for setting explicit term significance (in the tf/idf sense) to a single term or phrase, relative to the rest of the query. This influences ranking features which take term significance into account and overrides the default partial corpus based term significance computation happening in the backend.
public void setExplicitSignificance(boolean explicitSignificance)
public boolean hasExplicitSignificance()
public double getSignificance()