summaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@oath.com>2018-09-17 13:52:53 +0200
committerJon Bratseth <bratseth@oath.com>2018-09-17 13:52:53 +0200
commit9ab734145093fe978ec09af3f30d87845b857323 (patch)
tree54671e735b230bf1caca9f9b5f364023153ab6d7 /config-model
parent7c6537f8622663401693bcd80c162535b1fb1735 (diff)
Refactor: No separate string accessors
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/main/java/com/yahoo/searchdefinition/RankProfile.java22
-rw-r--r--config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionsTestCase.java6
2 files changed, 4 insertions, 24 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 b7890889d19..20b0631ce5e 100644
--- a/config-model/src/main/java/com/yahoo/searchdefinition/RankProfile.java
+++ b/config-model/src/main/java/com/yahoo/searchdefinition/RankProfile.java
@@ -522,28 +522,6 @@ public class RankProfile implements Serializable, Cloneable {
return (getInherited()!=null) && getInherited().getIgnoreDefaultRankFeatures();
}
- /**
- * Returns the string form of the second phase ranking expression.
- *
- * @return string form of second phase ranking expression
- */
- public String getSecondPhaseRankingString() {
- if (secondPhaseRanking != null) return secondPhaseRanking.getRoot().toString();
- if (getInherited() != null) return getInherited().getSecondPhaseRankingString();
- return null;
- }
-
- /**
- * Returns the string form of the first phase ranking expression.
- *
- * @return string form of first phase ranking expression
- */
- public String getFirstPhaseRankingString() {
- if (firstPhaseRanking != null) return firstPhaseRanking.getRoot().toString();
- if (getInherited() != null) return getInherited().getFirstPhaseRankingString();
- return null;
- }
-
/** Adds a function and returns it */
public RankingExpressionFunction addFunction(String name, List<String> arguments, String expression, boolean inline) {
try {
diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionsTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionsTestCase.java
index 1c4e67c3d11..fd048737b43 100644
--- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionsTestCase.java
+++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionsTestCase.java
@@ -31,8 +31,10 @@ public class RankingExpressionsTestCase extends SearchDefinitionTestCase {
assertEquals("var1", functions.get("titlematch$").function().arguments().get(0));
assertEquals("var2", functions.get("titlematch$").function().arguments().get(1));
assertEquals("var1 * var2 + 890", functions.get("titlematch$").function().getBody().getRoot().toString());
- assertEquals("0.8 + 0.2 * titlematch$(4,5) + 0.8 * titlematch$(7,8) * closeness(distance)", functionsRankProfile.getFirstPhaseRankingString().trim());
- assertEquals("78 + closeness(distance)", functions.get("artistmatch").function().getBody().getRoot().toString());
+ assertEquals("0.8 + 0.2 * titlematch$(4,5) + 0.8 * titlematch$(7,8) * closeness(distance)",
+ functionsRankProfile.getFirstPhaseRanking().getRoot().toString());
+ assertEquals("78 + closeness(distance)",
+ functions.get("artistmatch").function().getBody().getRoot().toString());
assertEquals(0, functions.get("artistmatch").function().arguments().size());
List<Pair<String, String>> rankProperties = new RawRankProfile(functionsRankProfile,