Package com.yahoo.prelude.query
Class SameElementItem
- java.lang.Object
-
- com.yahoo.prelude.query.Item
-
- com.yahoo.prelude.query.CompositeItem
-
- com.yahoo.prelude.query.NonReducibleCompositeItem
-
- com.yahoo.prelude.query.SameElementItem
-
- All Implemented Interfaces:
java.lang.Cloneable
@Beta public class SameElementItem extends NonReducibleCompositeItem
This represents a query where all terms are required to match in the same element id. The primary usecase is to allow efficient search in arrays and maps of struct. The common path is the field name containing the struct.- Author:
- baldersheim
-
-
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, explicitSignificance, significance, uniqueID
-
-
Constructor Summary
Constructors Constructor Description SameElementItem(java.lang.String commonPath)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
adding(Item item)
protected void
appendBodyString(java.lang.StringBuilder buffer)
Override to append the item body in the canonical query language of this item.protected void
appendHeadingString(java.lang.StringBuilder buffer)
Appends the heading of this string.protected void
encodeThis(java.nio.ByteBuffer buffer)
Encodes just this item, not it's usual subitems, to the given buffer.java.util.Optional<Item>
extractSingleChild()
Will return its single child if itself can safely be omitted.java.lang.String
getFieldName()
Item.ItemType
getItemType()
Return the enumerated type of this item.java.lang.String
getName()
Returns the name of this item-
Methods inherited from class com.yahoo.prelude.query.CompositeItem
addItem, addItem, clone, disclose, encode, encodingArity, ensureNotInSubtree, equals, getItem, getItemCount, getItemIndex, getItemIterator, getTermCount, hashCode, isLocked, items, lock, removeItem, removeItem, setIndexName, 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
-
-
-
-
Method Detail
-
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
-
appendHeadingString
protected void appendHeadingString(java.lang.StringBuilder buffer)
Description copied from class:Item
Appends the heading of this string. As default getName() followed by a space.- Overrides:
appendHeadingString
in classItem
-
appendBodyString
protected void appendBodyString(java.lang.StringBuilder buffer)
Description copied from class:Item
Override to append the item body in the canonical query language of this item. An item is usually represented by the string([itemName] [body])
The body must be appended appended by this method.- Overrides:
appendBodyString
in classCompositeItem
-
adding
protected void adding(Item item)
- Overrides:
adding
in classCompositeItem
-
extractSingleChild
public java.util.Optional<Item> extractSingleChild()
Description copied from class:CompositeItem
Will return its single child if itself can safely be omitted.- Overrides:
extractSingleChild
in classNonReducibleCompositeItem
- Returns:
- a valid Item or empty Optional if it can not be done
-
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
-
getFieldName
public java.lang.String getFieldName()
-
-