public class Diversity extends Object implements 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.
Modifier and Type | Class and Description |
---|---|
static class |
Diversity.CutoffStrategy |
Modifier and Type | Field and Description |
---|---|
private static QueryProfileType |
argumentType
The type representing the property arguments consumed by this
|
private String |
attribute |
static String |
ATTRIBUTE |
static String |
CUTOFF |
private Double |
cutoffFactor |
private Diversity.CutoffStrategy |
cutoffStrategy |
static String |
FACTOR |
private Long |
minGroups |
static String |
MINGROUPS |
static String |
STRATEGY |
Constructor and Description |
---|
Diversity() |
Modifier and Type | Method and Description |
---|---|
Diversity |
clone() |
boolean |
equals(Object o) |
static QueryProfileType |
getArgumentType() |
String |
getAttribute()
Returns the attribute to use for diversity, or null if none
|
Double |
getCutoffFactor() |
Diversity.CutoffStrategy |
getCutoffStrategy() |
Long |
getMinGroups()
Returns the max hits to aim for producing in the match phase on each content node, or null if not set
|
int |
hashCode() |
void |
prepare(RankProperties rankProperties)
Internal operation - DO NOT USE
|
void |
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.
|
private static final QueryProfileType argumentType
public static final String ATTRIBUTE
public static final String MINGROUPS
public static final String CUTOFF
public static final String FACTOR
public static final String STRATEGY
private String attribute
private Long minGroups
private Double cutoffFactor
private Diversity.CutoffStrategy cutoffStrategy
public static QueryProfileType getArgumentType()
public void setAttribute(String attribute)
If this is set, make sure to also set the maxGroups value.
This attribute must be singlevalue.
public String getAttribute()
public void setMinGroups(long minGroups)
public Long getMinGroups()
public void setCutoffFactor(double cutoffFactor)
public Double getCutoffFactor()
public void setCutoffStrategy(String cutoffStrategy)
public Diversity.CutoffStrategy getCutoffStrategy()
public void prepare(RankProperties rankProperties)
Copyright © 2018. All rights reserved.