Package com.yahoo.search.query.ranking
Class Diversity
java.lang.Object
com.yahoo.search.query.ranking.Diversity
- All Implemented Interfaces:
Cloneable
The diversity settings during match phase of a query. These are the same settings for diversity during match phase that can be set in a rank profile and is used for achieving guaranteed diversity at the cost of slightly higher cost as more hits must be considered compared to plain match-phase.
You specify an additional attribute to be the diversifier and also min diversity needed.
- Author:
- baldersheim
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
boolean
static QueryProfileType
Returns the attribute to use for diversity, or null if noneReturns the max hits to aim for producing in the match phase on each content node, or null if not setint
hashCode()
void
prepare
(RankProperties rankProperties) Internal operation - DO NOT USEvoid
setAttribute
(String attribute) Sets the attribute field which will be used to guarantee diversity.void
setCutoffFactor
(double cutoffFactor) void
setCutoffStrategy
(String cutoffStrategy) void
setMinGroups
(long minGroups) Sets the max hits to aim for producing in the match phase.
-
Field Details
-
ATTRIBUTE
- See Also:
-
MINGROUPS
- See Also:
-
CUTOFF
- See Also:
-
FACTOR
- See Also:
-
STRATEGY
- See Also:
-
-
Constructor Details
-
Diversity
public Diversity()
-
-
Method Details
-
getArgumentType
-
setAttribute
Sets the attribute field which will be used to guarantee diversity. Set to null (default) to disable diversification.If this is set, make sure to also set the maxGroups value.
This attribute must be singlevalue.
-
getAttribute
Returns the attribute to use for diversity, or null if none -
setMinGroups
public void setMinGroups(long minGroups) Sets the max hits to aim for producing in the match phase. This must be set if an attribute value is set. It should be set to a reasonable fraction of the total documents on each partition. -
getMinGroups
Returns the max hits to aim for producing in the match phase on each content node, or null if not set -
setCutoffFactor
public void setCutoffFactor(double cutoffFactor) -
getCutoffFactor
-
setCutoffStrategy
-
getCutoffStrategy
-
prepare
Internal operation - DO NOT USE -
clone
-
hashCode
public int hashCode() -
equals
-