Package com.yahoo.search.query.ranking
Class Diversity
- java.lang.Object
-
- com.yahoo.search.query.ranking.Diversity
-
- All Implemented Interfaces:
java.lang.Cloneable
public class Diversity extends java.lang.Object implements java.lang.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
Nested Classes Modifier and Type Class Description static class
Diversity.CutoffStrategy
-
Constructor Summary
Constructors Constructor Description Diversity()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Diversity
clone()
boolean
equals(java.lang.Object o)
static QueryProfileType
getArgumentType()
java.lang.String
getAttribute()
Returns the attribute to use for diversity, or null if nonejava.lang.Double
getCutoffFactor()
Diversity.CutoffStrategy
getCutoffStrategy()
java.lang.Long
getMinGroups()
Returns 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(java.lang.String attribute)
Sets the attribute field which will be used to guarantee diversity.void
setCutoffFactor(double cutoffFactor)
void
setCutoffStrategy(java.lang.String cutoffStrategy)
void
setMinGroups(long minGroups)
Sets the max hits to aim for producing in the match phase.
-
-
-
Field Detail
-
ATTRIBUTE
public static final java.lang.String ATTRIBUTE
- See Also:
- Constant Field Values
-
MINGROUPS
public static final java.lang.String MINGROUPS
- See Also:
- Constant Field Values
-
CUTOFF
public static final java.lang.String CUTOFF
- See Also:
- Constant Field Values
-
FACTOR
public static final java.lang.String FACTOR
- See Also:
- Constant Field Values
-
STRATEGY
public static final java.lang.String STRATEGY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getArgumentType
public static QueryProfileType getArgumentType()
-
setAttribute
public void setAttribute(java.lang.String attribute)
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
public java.lang.String 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
public java.lang.Long 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
public java.lang.Double getCutoffFactor()
-
setCutoffStrategy
public void setCutoffStrategy(java.lang.String cutoffStrategy)
-
getCutoffStrategy
public Diversity.CutoffStrategy getCutoffStrategy()
-
prepare
public void prepare(RankProperties rankProperties)
Internal operation - DO NOT USE
-
clone
public Diversity clone()
- Overrides:
clone
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
-