diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-02-12 20:18:33 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-02-12 20:18:33 +0200 |
commit | a1d2d8c438ac22df82c32ad1400fbdd86d232a45 (patch) | |
tree | 1e1f8aa88c8be3b592a07367cf3534afdda80a99 /config-model/src/main/java/com/yahoo/searchdefinition | |
parent | 55ff951d65ea4e0b2b8b847faaa25057c7f00f1f (diff) |
Argh, none of these were inherited....
Diffstat (limited to 'config-model/src/main/java/com/yahoo/searchdefinition')
-rw-r--r-- | config-model/src/main/java/com/yahoo/searchdefinition/RankProfile.java | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/RankProfile.java b/config-model/src/main/java/com/yahoo/searchdefinition/RankProfile.java index 84504361d1f..c828f6beba3 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/RankProfile.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/RankProfile.java @@ -55,7 +55,7 @@ public class RankProfile implements Serializable, Cloneable { private int minHitsPerThread = -1; private int numSearchPartitions = -1; - private double termwiseLimit = 1.0; + private Double termwiseLimit = null; /** The drop limit used to drop hits with rank score less than or equal to this value */ private double rankScoreDropLimit = -Double.MAX_VALUE; @@ -426,13 +426,15 @@ public class RankProfile implements Serializable, Cloneable { } public int getRerankCount() { - if (rerankCount>=0) return rerankCount; - if (getInherited()!=null) return getInherited().getRerankCount(); - return -1; + return (rerankCount < 0 && (getInherited() != null)) + ? getInherited().getRerankCount() + : rerankCount; } public int getNumThreadsPerSearch() { - return numThreadsPerSearch; + return (numThreadsPerSearch < 0 && (getInherited() != null)) + ? getInherited().getNumThreadsPerSearch() + : numThreadsPerSearch; } public void setNumThreadsPerSearch(int numThreads) { @@ -440,7 +442,9 @@ public class RankProfile implements Serializable, Cloneable { } public int getMinHitsPerThread() { - return minHitsPerThread; + return (minHitsPerThread < 0 && (getInherited() != null)) + ? getInherited().getMinHitsPerThread() + : minHitsPerThread; } public void setMinHitsPerThread(int minHits) { @@ -451,9 +455,17 @@ public class RankProfile implements Serializable, Cloneable { this.numSearchPartitions = numSearchPartitions; } - public int getNumSearchPartitions() { return numSearchPartitions; } + public int getNumSearchPartitions() { + return (numSearchPartitions < 0 && (getInherited() != null)) + ? getInherited().getNumSearchPartitions() + : numSearchPartitions; + } - public double getTermwiseLimit() { return termwiseLimit; } + public double getTermwiseLimit() { + return ((termwiseLimit == null) && (getInherited() != null)) + ? getInherited().getTermwiseLimit() + : (termwiseLimit != null) ? termwiseLimit : 1.0; + } public void setTermwiseLimit(double termwiseLimit) { this.termwiseLimit = termwiseLimit; } /** Sets the rerank count. Set to -1 to use inherited */ |