diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-10-25 10:34:45 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2021-10-25 10:34:45 +0200 |
commit | 85c88300cdab6541fea85cb69a7b4f844bb91250 (patch) | |
tree | aac7700c98b6a62efe2b104c54bac529d6ebf486 /config-model/src/test/java/com/yahoo/searchdefinition/RankPropertiesTestCase.java | |
parent | 832108f7de2bd4065d79198f23fd477c83c12939 (diff) |
Update execute -> mutate with '+=', '-=' and '='
Diffstat (limited to 'config-model/src/test/java/com/yahoo/searchdefinition/RankPropertiesTestCase.java')
-rw-r--r-- | config-model/src/test/java/com/yahoo/searchdefinition/RankPropertiesTestCase.java | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/RankPropertiesTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/RankPropertiesTestCase.java index e2ca8ac4f65..ceacd08bddc 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/RankPropertiesTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/RankPropertiesTestCase.java @@ -78,7 +78,7 @@ public class RankPropertiesTestCase extends AbstractSchemaTestCase { } } @Test - public void testRankProfileExecute() throws ParseException { + public void testRankProfileMutate() throws ParseException { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); SearchBuilder builder = new SearchBuilder(rankProfileRegistry); builder.importString(joinLines( @@ -101,15 +101,15 @@ public class RankPropertiesTestCase extends AbstractSchemaTestCase { " attribute: mutable", " }", " rank-profile a {", - " execute {", + " mutate {", " on-match {", - " synthetic_attribute_a ++", + " synthetic_attribute_a += 7", " }", " on-rerank {", " synthetic_attribute_b = 1.01", " }", " on-summary {", - " synthetic_attribute_c --", + " synthetic_attribute_c -= 1", " }", " }", " first-phase {", @@ -128,27 +128,27 @@ public class RankPropertiesTestCase extends AbstractSchemaTestCase { builder.build(); Schema schema = builder.getSearch(); RankProfile a = rankProfileRegistry.get(schema, "a"); - List<RankProfile.ExecuteOperation> operations = a.getExecuteOperations(); + List<RankProfile.MutateOperation> operations = a.getMutateOperations(); assertEquals(3, operations.size()); - assertEquals(RankProfile.ExecuteOperation.Phase.onmatch, operations.get(0).phase); + assertEquals(RankProfile.MutateOperation.Phase.onmatch, operations.get(0).phase); assertEquals("synthetic_attribute_a", operations.get(0).attribute); - assertEquals("++", operations.get(0).operation); - assertEquals(RankProfile.ExecuteOperation.Phase.onrerank, operations.get(1).phase); + assertEquals("+=7", operations.get(0).operation); + assertEquals(RankProfile.MutateOperation.Phase.onrerank, operations.get(1).phase); assertEquals("synthetic_attribute_b", operations.get(1).attribute); assertEquals("=1.01", operations.get(1).operation); - assertEquals(RankProfile.ExecuteOperation.Phase.onsummary, operations.get(2).phase); + assertEquals(RankProfile.MutateOperation.Phase.onsummary, operations.get(2).phase); assertEquals("synthetic_attribute_c", operations.get(2).attribute); - assertEquals("--", operations.get(2).operation); + assertEquals("-=1", operations.get(2).operation); AttributeFields attributeFields = new AttributeFields(schema); RawRankProfile raw = new RawRankProfile(a, new LargeRankExpressions(new MockFileRegistry()), new QueryProfileRegistry(), new ImportedMlModels(), attributeFields, new TestProperties()); assertEquals(7, raw.configProperties().size()); assertEquals("(vespa.execute.onmatch.attribute, synthetic_attribute_a)", raw.configProperties().get(0).toString()); - assertEquals("(vespa.execute.onmatch.operation, ++)", raw.configProperties().get(1).toString()); + assertEquals("(vespa.execute.onmatch.operation, +=7)", raw.configProperties().get(1).toString()); assertEquals("(vespa.execute.onrerank.attribute, synthetic_attribute_b)", raw.configProperties().get(2).toString()); assertEquals("(vespa.execute.onrerank.operation, =1.01)", raw.configProperties().get(3).toString()); assertEquals("(vespa.execute.onsummary.attribute, synthetic_attribute_c)", raw.configProperties().get(4).toString()); - assertEquals("(vespa.execute.onsummary.operation, --)", raw.configProperties().get(5).toString()); + assertEquals("(vespa.execute.onsummary.operation, -=1)", raw.configProperties().get(5).toString()); assertEquals("(vespa.rank.firstphase, a)", raw.configProperties().get(6).toString()); } |