Package com.yahoo.search.query.ranking
Class RankFeatures
java.lang.Object
com.yahoo.search.query.ranking.RankFeatures
- All Implemented Interfaces:
Cloneable
Contains the rank features of a query.
- Author:
- bratseth
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionasMap()
Returns the map holding the features of this.clone()
int
encode
(ByteBuffer buffer) boolean
Returns a double rank feature, or empty if there is no value with this name.Returns this value as either a Double, Tensor or String.Returns a rank feature as a string, or empty if there is no value with this name.Optional<com.yahoo.tensor.Tensor>
Returns a rank feature as a tensor, or empty if there is no value with this name.int
hashCode()
boolean
isEmpty()
static boolean
isFeatureName
(String fullPropertyName) void
prepare
(RankProperties rankProperties) Prepares this for encoding, not for external use.void
Sets a double rank featurevoid
Sets a tensor rank featurevoid
Sets a rank feature to a string.toString()
-
Constructor Details
-
RankFeatures
-
-
Method Details
-
put
Sets a double rank feature -
put
Sets a tensor rank feature -
put
Sets a rank feature to a string. This will be available as the hash value of the string in ranking, so it can be used in equality comparisons with other string, but not for any other purpose. -
getObject
Returns this value as either a Double, Tensor or String. Returns null if the value is not set. -
getDouble
Returns a double rank feature, or empty if there is no value with this name.- Throws:
IllegalArgumentException
- if the value is set but is not a double
-
getTensor
Returns a rank feature as a tensor, or empty if there is no value with this name.- Throws:
IllegalArgumentException
- if the value is a string, not a tensor or double
-
getString
Returns a rank feature as a string, or empty if there is no value with this name.- Throws:
IllegalArgumentException
- if the value is a tensor or double, not a string
-
asMap
Returns the map holding the features of this. This map may be modified to change the rank features of the query. -
isEmpty
public boolean isEmpty() -
prepare
Prepares this for encoding, not for external use. See encode on Query for details.If the query feature is found in the rank feature set, remove all these entries and insert them into the rank property set instead. We want to hide from the user that the query feature value is sent down as a rank property and picked up by the query feature executor in the backend.
-
encode
-
equals
-
hashCode
public int hashCode() -
clone
-
cloneFor
-
toString
-
isFeatureName
-