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
-
Method Summary
Modifier and TypeMethodDescriptiondouble
double
int
boolean
boolean
void
setConnectivity
(Item item, double connectivity) Set the connectivity to another term in the same query tree.void
setDocumentFrequency
(DocumentFrequency documentFrequency) void
setExplicitSignificance
(boolean explicitSignificance) void
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.void
setUniqueID
(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:
getUniqueID
in interfaceTaggableItem
-
setUniqueID
public void setUniqueID(int id) - Specified by:
setUniqueID
in interfaceTaggableItem
-
setConnectivity
Description copied from interface:TaggableItem
Set 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:
setConnectivity
in 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:
getConnectedItem
in interfaceTaggableItem
-
getConnectivity
public double getConnectivity()- Specified by:
getConnectivity
in interfaceTaggableItem
-
setSignificance
public void setSignificance(double significance) Description copied from interface:TaggableItem
Used 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:
setSignificance
in interfaceTaggableItem
-
setExplicitSignificance
public void setExplicitSignificance(boolean explicitSignificance) - Specified by:
setExplicitSignificance
in interfaceTaggableItem
-
hasExplicitSignificance
public boolean hasExplicitSignificance()- Specified by:
hasExplicitSignificance
in interfaceTaggableItem
-
getSignificance
public double getSignificance()- Specified by:
getSignificance
in interfaceTaggableItem
-
setDocumentFrequency
- Specified by:
setDocumentFrequency
in interfaceTaggableItem
-
getDocumentFrequency
- Specified by:
getDocumentFrequency
in interfaceTaggableItem
-
hasUniqueID
public boolean hasUniqueID()- Specified by:
hasUniqueID
in interfaceTaggableItem
- Overrides:
hasUniqueID
in classItem
-