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
Modifier and TypeClassDescriptionstatic class
A unique entry in a predicate item.static class
An entry in a predicate item.static class
A range entry in a predicate item.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, documentFrequency, explicitSignificance, significance, uniqueID
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a feature/value-pair to the predicate query.void
addFeature
(String key, String value) Adds a feature/value-pair to the predicate query.void
addFeature
(String key, String value, long subQueryBitmap) Adds a feature/value-pair to the predicate query.void
Adds a range feature with a given value to the predicate query.void
addRangeFeature
(String key, long value) Adds a range feature with a given value to the predicate query.void
addRangeFeature
(String key, long value, long subQueryBitmap) Adds a range feature with a given value to the predicate query.protected void
appendBodyString
(StringBuilder buffer) Override to append the item body in the canonical query language of this item.clone()
Returns a deep copy of this itemint
encode
(ByteBuffer buffer) boolean
Returns 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.int
int
hashCode()
void
setIndexName
(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, setUniqueID
Methods 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:
setIndexName
in 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: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 -
encode
-
getTermCount
public int getTermCount()- Specified by:
getTermCount
in classItem
-
appendBodyString
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.- Specified by:
appendBodyString
in classItem
-
clone
Description copied from class:Item
Returns a deep copy of this item -
equals
Description copied from class:Item
Returns whether this item is of the same class and contains the same state as the given item. -
hashCode
public int hashCode()
-