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:
Cloneable
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
Modifier and TypeFieldDescriptionstatic final int
The default N used if none is specified: 100Fields inherited from class com.yahoo.prelude.query.Item
connectedBacklink, connectedItem, connectivity, DEFAULT_WEIGHT, explicitSignificance, significance, uniqueID
-
Constructor Summary
ConstructorDescriptionCreates a WAND item with default NWeakAndItem
(int N) WeakAndItem
(String index, int n) Make a WeakAnd item with no children. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
appendHeadingString
(StringBuilder buffer) Appends the heading of this string -[getName()]([limit])
void
protected void
encodeThis
(ByteBuffer buffer) Encodes just this item, not its regular subitems, to the given buffer.boolean
Returns whether this item is of the same class and contains the same state as the given item.Returns the index name set for this, or null if none.Return the enumerated type of this item.int
getN()
getName()
Returns the name of this itemint
hashCode()
void
setIndexName
(String index) Sets the default index name to apply to all child items of this.void
setN
(int N) 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, shouldParenthesize
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 Details
-
defaultN
public static final int defaultNThe default N used if none is specified: 100- See Also:
-
-
Constructor Details
-
WeakAndItem
public WeakAndItem()Creates a WAND item with default N -
WeakAndItem
public WeakAndItem(int N) -
WeakAndItem
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.
-
-
Method Details
-
getItemType
Description copied from class:Item
Return the enumerated type of this item.- Specified by:
getItemType
in classItem
-
getName
Description copied from class:Item
Returns the name of this item -
setIndexName
Sets the default index name to apply to all child items of this. This is useful in conjunction with usingPureWeightedItem
s as children.- Overrides:
setIndexName
in classCompositeItem
-
getIndexName
Returns the index name set for this, or null if none. -
appendHeadingString
Appends the heading of this string -[getName()]([limit])
- Overrides:
appendHeadingString
in classItem
-
getN
public int getN() -
setN
public void setN(int N) -
encodeThis
Description copied from class:CompositeItem
Encodes just this item, not its regular subitems, to the given buffer.- Overrides:
encodeThis
in classCompositeItem
-
disclose
- Overrides:
disclose
in classCompositeItem
-
hashCode
public int hashCode()- Overrides:
hashCode
in classCompositeItem
-
equals
Returns whether this item is of the same class and contains the same state as the given item.- Overrides:
equals
in classCompositeItem
-