Package com.yahoo.prelude.query
Class CompositeTaggableItem
java.lang.Object
com.yahoo.prelude.query.Item
com.yahoo.prelude.query.CompositeItem
com.yahoo.prelude.query.CompositeTaggableItem
- All Implemented Interfaces:
TaggableItem
,Cloneable
- Direct Known Subclasses:
CompositeIndexedItem
,EquivItem
Common implementation for Item classes implementing the TaggableItem interface.
Note that this file exists 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) 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.CompositeItem
acceptsItemsOfType, adding, addItem, addItem, appendBodyString, clone, disclose, encode, encodeThis, encodingArity, ensureNotInSubtree, equals, extractSingleChild, getItem, getItemCount, getItemIndex, getItemIterator, getTermCount, hashCode, isLocked, items, lock, removeItem, removeItem, setIndexName, setItem, shouldParenthesize
Methods inherited from class com.yahoo.prelude.query.Item
addAnnotation, appendHeadingString, getAnnotation, getBytes, getCode, getCreator, getItemType, getLabel, getLanguage, getName, getParent, getWeight, hasAnnotation, hasConnectivityBackLink, hasPrefixMatchSemantics, isFilter, isFromSpecialToken, isProtected, isRanked, isRoot, putBytes, putString, setCreator, setFilter, setFromSpecialToken, setHasUniqueID, setLabel, setLanguage, setParent, setPositionData, setProtected, setRanked, setWeight, toString, usePositionData
-
Constructor Details
-
CompositeTaggableItem
public CompositeTaggableItem()
-
-
Method Details
-
getUniqueID
public int getUniqueID()- Specified by:
getUniqueID
in interfaceTaggableItem
-
setUniqueID
public void setUniqueID(int id) - Specified by:
setUniqueID
in interfaceTaggableItem
-
setConnectivity
- 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
-