Package com.yahoo.prelude.query
Class SimpleTaggableItem
java.lang.Object
com.yahoo.prelude.query.Item
com.yahoo.prelude.query.SimpleTaggableItem
- All Implemented Interfaces:
TaggableItem,Cloneable
- Direct Known Subclasses:
MultiRangeItem,NearestNeighborItem,PredicateQueryItem,SimpleIndexedItem,WeightedSetItem
Common 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).
- Author:
- arnej27959
-
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 TypeMethodDescriptiondoubledoubleintbooleanbooleanvoidsetConnectivity(Item item, double connectivity) Set the connectivity to another term in the same query tree.voidsetDocumentFrequency(DocumentFrequency documentFrequency) voidsetExplicitSignificance(boolean explicitSignificance) voidsetSignificance(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.voidsetUniqueID(int id) 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, hasPrefixMatchSemantics, isFilter, isFromSpecialToken, isProtected, isRanked, isRoot, putBytes, putString, setCreator, setFilter, setFromSpecialToken, setHasUniqueID, setIndexName, setLabel, setLanguage, setParent, setPositionData, setProtected, setRanked, setWeight, shouldParenthesize, toString, usePositionData
-
Constructor Details
-
SimpleTaggableItem
public SimpleTaggableItem()
-
-
Method Details
-
getUniqueID
public int getUniqueID()- Specified by:
getUniqueIDin interfaceTaggableItem
-
setUniqueID
public void setUniqueID(int id) - Specified by:
setUniqueIDin interfaceTaggableItem
-
setConnectivity
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 score higher 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:
setConnectivityin interfaceTaggableItem- Parameters:
item- the item this should be connected to - in practice the previous 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.
-
getConnectedItem
- Specified by:
getConnectedItemin interfaceTaggableItem
-
getConnectivity
public double getConnectivity()- Specified by:
getConnectivityin interfaceTaggableItem
-
setSignificance
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 in the backend.- Specified by:
setSignificancein interfaceTaggableItem
-
setExplicitSignificance
public void setExplicitSignificance(boolean explicitSignificance) - Specified by:
setExplicitSignificancein interfaceTaggableItem
-
hasExplicitSignificance
public boolean hasExplicitSignificance()- Specified by:
hasExplicitSignificancein interfaceTaggableItem
-
getSignificance
public double getSignificance()- Specified by:
getSignificancein interfaceTaggableItem
-
setDocumentFrequency
- Specified by:
setDocumentFrequencyin interfaceTaggableItem
-
getDocumentFrequency
- Specified by:
getDocumentFrequencyin interfaceTaggableItem
-
hasUniqueID
public boolean hasUniqueID()- Specified by:
hasUniqueIDin interfaceTaggableItem- Overrides:
hasUniqueIDin classItem
-