aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/search/query/Ranking.java
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2016-11-25 14:32:21 +0100
committerHenning Baldersheim <balder@yahoo-inc.com>2017-01-25 18:55:21 +0100
commitc19fb20b2bdb12ed6e1c1aa5cc7b9e7efb033b84 (patch)
tree538ad4eba247a9d74ac5c53befc80fa4898e967e /container-search/src/main/java/com/yahoo/search/query/Ranking.java
parent29ee9162845ffaeb01f22a242d2fc7ab9593530e (diff)
Add the softtimeout query control.
Diffstat (limited to 'container-search/src/main/java/com/yahoo/search/query/Ranking.java')
-rw-r--r--container-search/src/main/java/com/yahoo/search/query/Ranking.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/query/Ranking.java b/container-search/src/main/java/com/yahoo/search/query/Ranking.java
index e543589f74d..addd759cd29 100644
--- a/container-search/src/main/java/com/yahoo/search/query/Ranking.java
+++ b/container-search/src/main/java/com/yahoo/search/query/Ranking.java
@@ -37,6 +37,7 @@ public class Ranking implements Cloneable {
public static final String QUERYCACHE = "queryCache";
public static final String MATCH_PHASE = "matchPhase";
public static final String DIVERSITY = "diversity";
+ public static final String SOFTTIMEOUT = "softtimeout";
public static final String FEATURES = "features";
public static final String PROPERTIES = "properties";
@@ -82,6 +83,8 @@ public class Ranking implements Cloneable {
private MatchPhase matchPhase = new MatchPhase();
+ private SoftTimeout softTimeout = new SoftTimeout();
+
public Ranking(Query parent) {
this.parent = parent;
}
@@ -169,6 +172,9 @@ public class Ranking implements Cloneable {
/** Returns the match phase rank settings of this. This is never null. */
public MatchPhase getMatchPhase() { return matchPhase; }
+ /** Returns the soft timeout settings of this. This is never null. */
+ public SoftTimeout getSoftTimeout() { return softTimeout; }
+
@Override
public Object clone() {
try {
@@ -179,6 +185,7 @@ public class Ranking implements Cloneable {
clone.rankProperties = this.rankProperties.clone();
clone.rankFeatures = this.rankFeatures.clone();
clone.matchPhase = this.matchPhase.clone();
+ clone.softTimeout = this.softTimeout.clone();
return clone;
}
catch (CloneNotSupportedException e) {
@@ -208,6 +215,7 @@ public class Ranking implements Cloneable {
hash += 11 * rankFeatures.hashCode();
hash += 13 * rankProperties.hashCode();
hash += 17 * matchPhase.hashCode();
+ hash += 19 * softTimeout.hashCode();
return Ranking.class.hashCode() + QueryHelper.combineHash(sorting,location,profile,hash);
}
@@ -232,6 +240,7 @@ public class Ranking implements Cloneable {
public void prepare() {
rankFeatures.prepare(rankProperties);
matchPhase.prepare(rankProperties);
+ softTimeout.prepare(rankProperties);
prepareNow(freshness);
}