Package com.yahoo.prelude.query
Class PredicateQueryItem
java.lang.Object
com.yahoo.prelude.query.Item
com.yahoo.prelude.query.SimpleTaggableItem
com.yahoo.prelude.query.PredicateQueryItem
- All Implemented Interfaces:
TaggableItem,Cloneable
A PredicateQueryItem is a collection of feature/value-pairs
that are used to query predicate fields, which contains boolean
constraints. If the feature/value-pairs from the PredicateQueryItem
satisfies the boolean constraints, the document is a match.
- Author:
- Magnar Nedland
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA unique entry in a predicate item.static classAn entry in a predicate item.static classA range entry in a predicate item.Nested classes/interfaces inherited from class com.yahoo.prelude.query.Item
Item.ItemCreator, Item.ItemType -
Field Summary
FieldsFields inherited from class com.yahoo.prelude.query.Item
connectedBacklink, connectedItem, connectivity, DEFAULT_WEIGHT, documentFrequency, explicitSignificance, significance, uniqueID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a feature/value-pair to the predicate query.voidaddFeature(String key, String value) Adds a feature/value-pair to the predicate query.voidaddFeature(String key, String value, long subQueryBitmap) Adds a feature/value-pair to the predicate query.voidAdds a range feature with a given value to the predicate query.voidaddRangeFeature(String key, long value) Adds a range feature with a given value to the predicate query.voidaddRangeFeature(String key, long value, long subQueryBitmap) Adds a range feature with a given value to the predicate query.protected voidappendBodyString(StringBuilder buffer) Override to append the item body in the canonical query language of this item.clone()Returns a deep copy of this itemintencode(ByteBuffer buffer) booleanReturns whether this item is of the same class and contains the same state as the given item.Returns a mutable collection of feature entries.Returns the name of the index (field) used for the predicates.Return the enumerated type of this item.getName()Returns the name of this itemReturns a mutable collection of range feature entries.intinthashCode()voidsetIndexName(String index) Sets the name of the index (field) to be used for the predicates.Methods inherited from class com.yahoo.prelude.query.SimpleTaggableItem
getConnectedItem, getConnectivity, getDocumentFrequency, getSignificance, getUniqueID, hasExplicitSignificance, hasUniqueID, setConnectivity, setDocumentFrequency, setExplicitSignificance, setSignificance, setUniqueIDMethods inherited from class com.yahoo.prelude.query.Item
addAnnotation, appendHeadingString, disclose, encodeThis, getAnnotation, getBytes, getCode, getCreator, getLabel, getLanguage, getParent, getWeight, hasAnnotation, hasConnectivityBackLink, hasPrefixMatchSemantics, isFilter, isFromSpecialToken, isProtected, isRanked, isRoot, putBytes, putString, setCreator, setFilter, setFromSpecialToken, setHasUniqueID, setLabel, setLanguage, setParent, setPositionData, setProtected, setRanked, setWeight, shouldParenthesize, toString, usePositionData
-
Field Details
-
ALL_SUB_QUERIES
public static final long ALL_SUB_QUERIES- See Also:
-
-
Constructor Details
-
PredicateQueryItem
public PredicateQueryItem()
-
-
Method Details
-
setIndexName
Sets the name of the index (field) to be used for the predicates.- Specified by:
setIndexNamein classItem
-
getIndexName
Returns the name of the index (field) used for the predicates. -
addFeature
Adds a feature/value-pair to the predicate query. This feature is applied to all sub queries.- Parameters:
key- name of the feature to be set in this queryvalue- value of the feature
-
addFeature
Adds a feature/value-pair to the predicate query.- Parameters:
key- name of the feature to be set in this queryvalue- value of the featuresubQueryBitmap- bitmap specifying which sub queries this feature applies to
-
addFeature
Adds a feature/value-pair to the predicate query.- Parameters:
entry- the feature to add
-
addRangeFeature
Adds a range feature with a given value to the predicate query. This feature is applied to all sub queries.- Parameters:
key- name of the feature to be set in this queryvalue- value of the feature
-
addRangeFeature
Adds a range feature with a given value to the predicate query.- Parameters:
key- name of the feature to be set in this queryvalue- value of the featuresubQueryBitmap- bitmap specifying which sub queries this feature applies to
-
addRangeFeature
Adds a range feature with a given value to the predicate query.- Parameters:
entry- the feature to add
-
getFeatures
Returns a mutable collection of feature entries. -
getRangeFeatures
Returns a mutable collection of range feature entries. -
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 -
encode
-
getTermCount
public int getTermCount()- Specified by:
getTermCountin classItem
-
appendBodyString
Description copied from class:ItemOverride 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 by this method.- Specified by:
appendBodyStringin classItem
-
clone
Description copied from class:ItemReturns a deep copy of this item -
equals
Description copied from class:ItemReturns whether this item is of the same class and contains the same state as the given item. -
hashCode
public int hashCode()
-