diff options
author | Jon Bratseth <bratseth@gmail.com> | 2021-10-16 23:11:13 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2021-10-16 23:11:13 +0200 |
commit | 107c889b203a1e73dd342450a538459b4911c7fd (patch) | |
tree | 2a87f9975c19a91b505733460839fb65ecaceeaa /config-model/src/test/java/com/yahoo/searchdefinition/SchemaTestCase.java | |
parent | 99db4d19f2298ec2b0441eea7e682cf924f833cd (diff) |
Inherit indexes
Diffstat (limited to 'config-model/src/test/java/com/yahoo/searchdefinition/SchemaTestCase.java')
-rw-r--r-- | config-model/src/test/java/com/yahoo/searchdefinition/SchemaTestCase.java | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/SchemaTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/SchemaTestCase.java index 00a7715cfdc..16b01563e55 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/SchemaTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/SchemaTestCase.java @@ -67,16 +67,22 @@ public class SchemaTestCase { @Test public void testSchemaInheritance() throws ParseException { - String parent = joinLines( + String parentLines = joinLines( "schema parent {" + " document parent {" + " field pf1 type string {" + " indexing: summary" + " }" + " }" + + " fieldset parent_set {" + + " fields: pf1" + + " }" + " stemming: none" + + " index parent_index {" + + " stemming: best" + + " }" + "}"); - String child = joinLines( + String childLines = joinLines( "schema child inherits parent {" + " document child inherits parent {" + " field cf1 type string {" + @@ -84,8 +90,12 @@ public class SchemaTestCase { " }" + " }" + "}"); - var application = SearchBuilder.createFromStrings(new DeployLoggerStub(), parent, child).application(); - assertEquals(Stemming.NONE, application.schemas().get("child").getStemming()); + var application = SearchBuilder.createFromStrings(new DeployLoggerStub(), parentLines, childLines).application(); + var child = application.schemas().get("child"); + + assertEquals("pf1", child.fieldSets().userFieldSets().get("parent_set").getFieldNames().stream().findFirst().get()); + assertEquals(Stemming.NONE, child.getStemming()); + assertEquals(Stemming.BEST, child.getIndex("parent_index").getStemming()); } } |