Package com.yahoo.prelude.query
Class WeakAndItem
- java.lang.Object
-
- com.yahoo.prelude.query.Item
-
- com.yahoo.prelude.query.CompositeItem
-
- com.yahoo.prelude.query.NonReducibleCompositeItem
-
- com.yahoo.prelude.query.WeakAndItem
-
- All Implemented Interfaces:
java.lang.Cloneable
public final class WeakAndItem extends NonReducibleCompositeItem
Weak And of a collection of sub-expressions: this behaves like an OR unless many hits are returned and then it starts acting more like an AND. Alternately it can be viewed as an n-of-m operator where n is 1 at first and then increases gradually to m as more hits are seen.- Author:
- arnej27959
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.yahoo.prelude.query.Item
Item.ItemCreator, Item.ItemType
-
-
Field Summary
Fields Modifier and Type Field Description static int
defaultN
The default N used if none is specified: 100-
Fields inherited from class com.yahoo.prelude.query.Item
connectedBacklink, connectedItem, connectivity, DEFAULT_WEIGHT, explicitSignificance, significance, uniqueID
-
-
Constructor Summary
Constructors Constructor Description WeakAndItem()
Creates a WAND item with default NWeakAndItem(int N)
WeakAndItem(java.lang.String index, int n)
Make a WeakAnd item with no children.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
appendHeadingString(java.lang.StringBuilder buffer)
Appends the heading of this string -[getName()]([limit])
void
disclose(com.yahoo.prelude.query.textualrepresentation.Discloser discloser)
protected void
encodeThis(java.nio.ByteBuffer buffer)
Encodes just this item, not it's usual subitems, to the given buffer.boolean
equals(java.lang.Object object)
Returns whether this item is of the same class and contains the same state as the given item.java.lang.String
getIndexName()
Item.ItemType
getItemType()
Return the enumerated type of this item.int
getN()
java.lang.String
getName()
Returns the name of this itemint
getScoreThreshold()
Deprecated.int
hashCode()
void
setIndexName(java.lang.String index)
Sets the index name of all subitems of thisvoid
setN(int N)
void
setScoreThreshold(int scoreThreshold)
Deprecated.has no effect-
Methods inherited from class com.yahoo.prelude.query.NonReducibleCompositeItem
extractSingleChild
-
Methods inherited from class com.yahoo.prelude.query.CompositeItem
adding, addItem, addItem, appendBodyString, clone, encode, encodingArity, ensureNotInSubtree, getItem, getItemCount, getItemIndex, getItemIterator, getTermCount, isLocked, items, lock, removeItem, removeItem, setItem, shouldParenthize
-
Methods inherited from class com.yahoo.prelude.query.Item
addAnnotation, getAnnotation, getBytes, getCode, getCreator, getLabel, getLanguage, getParent, getWeight, hasAnnotation, hasConnectivityBackLink, hasUniqueID, isFilter, isFromSpecialToken, isProtected, isRanked, isRoot, putBytes, putString, setCreator, setFilter, setFromSpecialToken, setHasUniqueID, setLabel, setLanguage, setParent, setPositionData, setProtected, setRanked, setWeight, toString, usePositionData
-
-
-
-
Field Detail
-
defaultN
public static final int defaultN
The default N used if none is specified: 100- See Also:
- Constant Field Values
-
-
Constructor Detail
-
WeakAndItem
public WeakAndItem(java.lang.String index, int n)
Make a WeakAnd item with no children. You can mention a common index or you can mention it on each child.- Parameters:
index
- the index to searchn
- the target for minimum number of hits to produce; a backend will not suppress any hits in the operator until N hits have been produced.
-
WeakAndItem
public WeakAndItem(int N)
-
WeakAndItem
public WeakAndItem()
Creates a WAND item with default N
-
-
Method Detail
-
getItemType
public Item.ItemType getItemType()
Description copied from class:Item
Return the enumerated type of this item.- Specified by:
getItemType
in classItem
-
getName
public java.lang.String getName()
Description copied from class:Item
Returns the name of this item
-
setIndexName
public void setIndexName(java.lang.String index)
Sets the index name of all subitems of this- Overrides:
setIndexName
in classCompositeItem
-
getIndexName
public java.lang.String getIndexName()
-
appendHeadingString
protected void appendHeadingString(java.lang.StringBuilder buffer)
Appends the heading of this string -[getName()]([limit])
- Overrides:
appendHeadingString
in classItem
-
getN
public int getN()
-
setN
public void setN(int N)
-
getScoreThreshold
@Deprecated public int getScoreThreshold()
Deprecated.
-
setScoreThreshold
@Deprecated public void setScoreThreshold(int scoreThreshold)
Deprecated.has no effectNoop.
-
encodeThis
protected void encodeThis(java.nio.ByteBuffer buffer)
Description copied from class:CompositeItem
Encodes just this item, not it's usual subitems, to the given buffer.- Overrides:
encodeThis
in classCompositeItem
-
disclose
public void disclose(com.yahoo.prelude.query.textualrepresentation.Discloser discloser)
- Overrides:
disclose
in classCompositeItem
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classCompositeItem
-
equals
public boolean equals(java.lang.Object object)
Returns whether this item is of the same class and contains the same state as the given item.- Overrides:
equals
in classCompositeItem
-
-