Package com.yahoo.search.query
Class Ranking
- java.lang.Object
-
- com.yahoo.search.query.Ranking
-
- All Implemented Interfaces:
java.lang.Cloneable
public class Ranking extends java.lang.Object implements java.lang.Cloneable
The ranking (hit ordering) settings of a query- Author:
- Arne Bergene Fossaa, bratseth
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DIVERSITY
static java.lang.String
FEATURES
static java.lang.String
FRESHNESS
static java.lang.String
LIST_FEATURES
static java.lang.String
LOCATION
static java.lang.String
MATCH_PHASE
static java.lang.String
MATCHING
static java.lang.String
PROFILE
static java.lang.String
PROPERTIES
static java.lang.String
QUERYCACHE
static com.yahoo.processing.request.CompoundName
RANKFEATURES
An alias for listing featuresstatic java.lang.String
RANKING
static java.lang.String
RERANKCOUNT
static java.lang.String
SOFTTIMEOUT
static java.lang.String
SORTING
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone()
boolean
equals(java.lang.Object o)
static QueryProfileType
getArgumentType()
RankFeatures
getFeatures()
Returns the rank features of this, an empty container (never null) if none are set.Freshness
getFreshness()
Get the freshness search parameters associated with this querystatic Ranking
getFrom(Query q)
boolean
getListFeatures()
Returns whether rank features should be dumped with the result of this query, default falseLocation
getLocation()
Returns the location of this query, or null if noneMatching
getMatching()
Returns the matching settings of this.MatchPhase
getMatchPhase()
Returns the match phase rank settings of this.java.lang.String
getProfile()
Returns the name of the rank profile to be used.RankProperties
getProperties()
Returns the rank properties of this, an empty container (never null) if none are set.boolean
getQueryCache()
java.lang.Integer
getRerankCount()
Returns the rerank-count that will be used, or null if not setSoftTimeout
getSoftTimeout()
Returns the soft timeout settings of this.Sorting
getSorting()
Returns the sorting spec of this query, or null if none is setint
hashCode()
boolean
hasRankProfile()
Returns whether a rank profile has been explicitly set.void
prepare()
void
setFreshness(Freshness freshness)
void
setFreshness(java.lang.String dateTime)
Set the freshness search parameters for this queryvoid
setListFeatures(boolean listFeatures)
Set whether rank features should be included with the result of this queryvoid
setLocation(Location location)
void
setLocation(java.lang.String str)
Sets the location from a string, seeLocation
for syntaxvoid
setProfile(java.lang.String profile)
Sets the name of the rank profile to use.void
setQueryCache(boolean queryCache)
Returns whether feature caching is turned on in the backed.void
setRerankCount(int rerankCount)
Sets the number of hits for which the second-phase function will be evaluated.void
setSorting(Sorting sorting)
Sets how this query should be sorted.void
setSorting(java.lang.String sortingString)
Sets sorting from a string.
-
-
-
Field Detail
-
RANKFEATURES
public static final com.yahoo.processing.request.CompoundName RANKFEATURES
An alias for listing features
-
RANKING
public static final java.lang.String RANKING
- See Also:
- Constant Field Values
-
LOCATION
public static final java.lang.String LOCATION
- See Also:
- Constant Field Values
-
PROFILE
public static final java.lang.String PROFILE
- See Also:
- Constant Field Values
-
SORTING
public static final java.lang.String SORTING
- See Also:
- Constant Field Values
-
LIST_FEATURES
public static final java.lang.String LIST_FEATURES
- See Also:
- Constant Field Values
-
FRESHNESS
public static final java.lang.String FRESHNESS
- See Also:
- Constant Field Values
-
QUERYCACHE
public static final java.lang.String QUERYCACHE
- See Also:
- Constant Field Values
-
RERANKCOUNT
public static final java.lang.String RERANKCOUNT
- See Also:
- Constant Field Values
-
MATCH_PHASE
public static final java.lang.String MATCH_PHASE
- See Also:
- Constant Field Values
-
DIVERSITY
public static final java.lang.String DIVERSITY
- See Also:
- Constant Field Values
-
SOFTTIMEOUT
public static final java.lang.String SOFTTIMEOUT
- See Also:
- Constant Field Values
-
MATCHING
public static final java.lang.String MATCHING
- See Also:
- Constant Field Values
-
FEATURES
public static final java.lang.String FEATURES
- See Also:
- Constant Field Values
-
PROPERTIES
public static final java.lang.String PROPERTIES
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Ranking
public Ranking(Query parent)
-
-
Method Detail
-
getArgumentType
public static QueryProfileType getArgumentType()
-
hasRankProfile
public boolean hasRankProfile()
Returns whether a rank profile has been explicitly set. This is only used in serializing the packet properly to FS4.
-
getFreshness
public Freshness getFreshness()
Get the freshness search parameters associated with this query
-
setFreshness
public void setFreshness(java.lang.String dateTime)
Set the freshness search parameters for this query
-
setFreshness
public void setFreshness(Freshness freshness)
-
setQueryCache
public void setQueryCache(boolean queryCache)
Returns whether feature caching is turned on in the backed. Feature caching allows us to avoid sending the query during document summary retrieval and recalculate feature scores, it is typically beneficial to turn it on if fan-out is low or queries are large.Default is false (off).
-
getQueryCache
public boolean getQueryCache()
-
setRerankCount
public void setRerankCount(int rerankCount)
Sets the number of hits for which the second-phase function will be evaluated. When set, this overrides the setting in the rank profile.
-
getRerankCount
public java.lang.Integer getRerankCount()
Returns the rerank-count that will be used, or null if not set
-
getLocation
public Location getLocation()
Returns the location of this query, or null if none
-
setLocation
public void setLocation(Location location)
-
setLocation
public void setLocation(java.lang.String str)
Sets the location from a string, seeLocation
for syntax
-
getProfile
public java.lang.String getProfile()
Returns the name of the rank profile to be used. Returns "default" if nothing is set.
-
setProfile
public void setProfile(java.lang.String profile)
Sets the name of the rank profile to use. This cannot be set to null.
-
getFeatures
public RankFeatures getFeatures()
Returns the rank features of this, an empty container (never null) if none are set. The returned object can be modified directly to change the rank properties of this.
-
getProperties
public RankProperties getProperties()
Returns the rank properties of this, an empty container (never null) if none are set. The returned object can be modified directly to change the rank properties of this.
-
setListFeatures
public void setListFeatures(boolean listFeatures)
Set whether rank features should be included with the result of this query
-
getListFeatures
public boolean getListFeatures()
Returns whether rank features should be dumped with the result of this query, default false
-
getMatchPhase
public MatchPhase getMatchPhase()
Returns the match phase rank settings of this. This is never null.
-
getMatching
public Matching getMatching()
Returns the matching settings of this. This is never null.
-
getSoftTimeout
public SoftTimeout getSoftTimeout()
Returns the soft timeout settings of this. This is never null.
-
clone
public java.lang.Object clone()
- Overrides:
clone
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getSorting
public Sorting getSorting()
Returns the sorting spec of this query, or null if none is set
-
setSorting
public void setSorting(Sorting sorting)
Sets how this query should be sorted. Set to null to turn off explicit sorting.
-
setSorting
public void setSorting(java.lang.String sortingString)
Sets sorting from a string. SeeSorting
on syntax
-
prepare
public void prepare()
-
-