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
FieldsModifier and TypeFieldDescriptionstatic final intThe default N used if none is specified: 100Fields inherited from class com.yahoo.prelude.query.Item
connectedBacklink, connectedItem, connectivity, DEFAULT_WEIGHT, documentFrequency, explicitSignificance, significance, uniqueID -
Constructor Summary
ConstructorsConstructorDescriptionCreates 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 voidappendHeadingString(StringBuilder buffer) Appends the heading of this string -[getName()]([limit])voidintencode(ByteBuffer buffer) protected voidencodeThis(ByteBuffer buffer) Encodes just this item, not its regular subitems, to the given buffer.booleanReturns 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.intgetN()getName()Returns the name of this iteminthashCode()booleanvoidsetIndexName(String index) Sets the default index name to apply to all child items of this.voidsetN(int N) Methods inherited from class com.yahoo.prelude.query.NonReducibleCompositeItem
extractSingleChildMethods inherited from class com.yahoo.prelude.query.CompositeItem
acceptsItemsOfType, adding, addItem, addItem, appendBodyString, clone, encodingArity, ensureNotInSubtree, getItem, getItemCount, getItemIndex, getItemIterator, getTermCount, isLocked, items, lock, removeItem, removeItem, setItem, shouldParenthesizeMethods inherited from class com.yahoo.prelude.query.Item
addAnnotation, getAnnotation, getBytes, getCode, getCreator, getLabel, getLanguage, getParent, getWeight, hasAnnotation, hasConnectivityBackLink, hasPrefixMatchSemantics, 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:ItemReturn the enumerated type of this item.- Specified by:
getItemTypein classItem
-
getName
Description copied from class:ItemReturns 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 usingPureWeightedItems as children.- Overrides:
setIndexNamein classCompositeItem
-
getIndexName
Returns the index name set for this, or null if none. -
appendHeadingString
Appends the heading of this string -[getName()]([limit])- Overrides:
appendHeadingStringin classItem
-
getN
public int getN() -
nIsExplicit
public boolean nIsExplicit() -
setN
public void setN(int N) -
encodeThis
Description copied from class:CompositeItemEncodes just this item, not its regular subitems, to the given buffer.- Overrides:
encodeThisin classCompositeItem
-
encode
- Overrides:
encodein classCompositeItem
-
disclose
- Overrides:
disclosein classCompositeItem
-
hashCode
public int hashCode()- Overrides:
hashCodein classCompositeItem
-
equals
Returns whether this item is of the same class and contains the same state as the given item.- Overrides:
equalsin classCompositeItem
-