diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-10-25 18:59:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-25 18:59:41 +0200 |
commit | cb6a8b7ccc971f4264fd3e0cb1917ba94e75552f (patch) | |
tree | 63747934f64cc97eba39d0d759621b5e537bcd78 /config-model/src/test/java/com | |
parent | cf4b36c91e5ba616690ef77b100f815fa0b263ad (diff) | |
parent | c95477e05205f8bc034842ddc03dbde08f249596 (diff) |
Merge pull request #19726 from vespa-engine/bratseth/search-builder-cleanup
Bratseth/search builder cleanup
Diffstat (limited to 'config-model/src/test/java/com')
80 files changed, 358 insertions, 360 deletions
diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/ArraysTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/ArraysTestCase.java index 131c6e19c68..aaf75f0c852 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/ArraysTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/ArraysTestCase.java @@ -22,7 +22,7 @@ public class ArraysTestCase extends AbstractSchemaTestCase { @Test public void testArrayImporting() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/arrays.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/arrays.sd"); SDField tags = (SDField) schema.getDocument().getField("tags"); assertEquals(DataType.STRING, ((CollectionDataType)tags.getDataType()).getNestedType()); diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/ArraysWeightedSetsTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/ArraysWeightedSetsTestCase.java index 0d5a4b357b1..1dd2c987d90 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/ArraysWeightedSetsTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/ArraysWeightedSetsTestCase.java @@ -19,7 +19,7 @@ import static org.junit.Assert.assertTrue; public class ArraysWeightedSetsTestCase extends AbstractSchemaTestCase { @Test public void testArrayWeightedSetsImporting() throws java.io.IOException, com.yahoo.searchdefinition.parser.ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/arraysweightedsets.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/arraysweightedsets.sd"); SDField tags = (SDField) schema.getDocument().getField("tags"); assertTrue(tags.getDataType() instanceof ArrayDataType); diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/AttributeSettingsTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/AttributeSettingsTestCase.java index b891fc97924..8656e740333 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/AttributeSettingsTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/AttributeSettingsTestCase.java @@ -32,7 +32,7 @@ public class AttributeSettingsTestCase extends AbstractSchemaTestCase { @Test public void testAttributeSettings() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/attributesettings.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/attributesettings.sd"); SDField f1=(SDField) schema.getDocument().getField("f1"); assertEquals(1, f1.getAttributes().size()); @@ -93,7 +93,7 @@ public class AttributeSettingsTestCase extends AbstractSchemaTestCase { @Test public void requireThatFastAccessCanBeSet() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/attributesettings.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/attributesettings.sd"); SDField field = (SDField) schema.getDocument().getField("fast_access"); assertEquals(1, field.getAttributes().size()); Attribute attr = field.getAttributes().get(field.getName()); @@ -101,10 +101,10 @@ public class AttributeSettingsTestCase extends AbstractSchemaTestCase { } private Schema getSearch(String sd) throws ParseException { - SearchBuilder builder = new SearchBuilder(); + SchemaBuilder builder = new SchemaBuilder(); builder.importString(sd); builder.build(); - return builder.getSearch(); + return builder.getSchema(); } private Attribute getAttributeF(String sd) throws ParseException { diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/CommentTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/CommentTestCase.java index 35eccb19151..8b7f0885907 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/CommentTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/CommentTestCase.java @@ -18,7 +18,7 @@ public class CommentTestCase extends AbstractSchemaTestCase { @Test public void testComments() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/comment.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/comment.sd"); SDField field = schema.getConcreteField("a"); assertEquals("{ input a | tokenize normalize stem:\"BEST\" | summary a | index a; }", field.getIndexingScript().toString()); diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/DiversityTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/DiversityTestCase.java index e6191772904..7c5c5c6fccc 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/DiversityTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/DiversityTestCase.java @@ -15,7 +15,7 @@ public class DiversityTestCase { @Test public void testDiversity() throws ParseException { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder builder = new SearchBuilder(rankProfileRegistry); + SchemaBuilder builder = new SchemaBuilder(rankProfileRegistry); builder.importString( "search test {\n" + " document test { \n" + @@ -43,7 +43,7 @@ public class DiversityTestCase { " }\n" + "}\n"); builder.build(); - Schema s = builder.getSearch(); + Schema s = builder.getSchema(); RankProfile.MatchPhaseSettings matchPhase = rankProfileRegistry.get(s, "parent").getMatchPhaseSettings(); RankProfile.DiversitySettings diversity = matchPhase.getDiversity(); assertEquals("b", diversity.getAttribute()); @@ -60,7 +60,7 @@ public class DiversityTestCase { } @Test public void requireSingleNumericOrString() throws ParseException { - SearchBuilder builder = getSearchBuilder("field b type predicate { indexing: attribute }"); + SchemaBuilder builder = getSearchBuilder("field b type predicate { indexing: attribute }"); try { builder.build(); @@ -72,7 +72,7 @@ public class DiversityTestCase { @Test public void requireSingle() throws ParseException { - SearchBuilder builder = getSearchBuilder("field b type array<int> { indexing: attribute }"); + SchemaBuilder builder = getSearchBuilder("field b type array<int> { indexing: attribute }"); try { builder.build(); @@ -81,9 +81,9 @@ public class DiversityTestCase { assertEquals(getMessagePrefix() + "must be single value numeric, or enumerated attribute, but it is 'Array<int>'", e.getMessage()); } } - private SearchBuilder getSearchBuilder(String diversity) throws ParseException { + private SchemaBuilder getSearchBuilder(String diversity) throws ParseException { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder builder = new SearchBuilder(rankProfileRegistry); + SchemaBuilder builder = new SchemaBuilder(rankProfileRegistry); builder.importString( "search test {\n" + " document test { \n" + diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/IncorrectRankingExpressionFileRefTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/IncorrectRankingExpressionFileRefTestCase.java index aab8c9939d2..621e7061203 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/IncorrectRankingExpressionFileRefTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/IncorrectRankingExpressionFileRefTestCase.java @@ -21,7 +21,7 @@ public class IncorrectRankingExpressionFileRefTestCase extends AbstractSchemaTes public void testIncorrectRef() throws IOException, ParseException { try { RankProfileRegistry registry = new RankProfileRegistry(); - Schema schema = SearchBuilder.buildFromFile("src/test/examples/incorrectrankingexpressionfileref.sd", + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/incorrectrankingexpressionfileref.sd", registry, new QueryProfileRegistry()); new DerivedConfiguration(schema, registry); // cause rank profile parsing diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/IncorrectSummaryTypesTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/IncorrectSummaryTypesTestCase.java index 76f8c05c1c8..55593ef64e4 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/IncorrectSummaryTypesTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/IncorrectSummaryTypesTestCase.java @@ -15,7 +15,7 @@ public class IncorrectSummaryTypesTestCase extends AbstractSchemaTestCase { @Test public void testImportingIncorrect() throws ParseException { try { - SearchBuilder.createFromString( + SchemaBuilder.createFromString( "search incorrectsummarytypes {\n" + " document incorrectsummarytypes {\n" + " field somestring type string {\n" + diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/IndexSettingsTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/IndexSettingsTestCase.java index 0e25798fbe2..f2e50439306 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/IndexSettingsTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/IndexSettingsTestCase.java @@ -21,7 +21,7 @@ public class IndexSettingsTestCase extends AbstractSchemaTestCase { @Test public void testStemmingSettings() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/indexsettings.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/indexsettings.sd"); SDField usingDefault=(SDField) schema.getDocument().getField("usingdefault"); assertEquals(Stemming.SHORTEST,usingDefault.getStemming(schema)); @@ -38,7 +38,7 @@ public class IndexSettingsTestCase extends AbstractSchemaTestCase { @Test public void requireThatInterlavedFeaturesAreSetOnExtraField() throws ParseException { - SearchBuilder builder = SearchBuilder.createFromString(joinLines( + SchemaBuilder builder = SchemaBuilder.createFromString(joinLines( "search test {", " document test {", " field content type string {", @@ -52,7 +52,7 @@ public class IndexSettingsTestCase extends AbstractSchemaTestCase { " }", "}" )); - Schema schema = builder.getSearch(); + Schema schema = builder.getSchema(); Index contentIndex = schema.getIndex("content"); assertTrue(contentIndex.useInterleavedFeatures()); Index extraIndex = schema.getIndex("extra"); diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/IndexingParsingTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/IndexingParsingTestCase.java index 428114f47e5..60728ab7d99 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/IndexingParsingTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/IndexingParsingTestCase.java @@ -15,13 +15,13 @@ public class IndexingParsingTestCase extends AbstractSchemaTestCase { @Test public void requireThatIndexingExpressionsCanBeParsed() throws Exception { - assertNotNull(SearchBuilder.buildFromFile("src/test/examples/indexing.sd")); + assertNotNull(SchemaBuilder.buildFromFile("src/test/examples/indexing.sd")); } @Test public void requireThatParseExceptionPositionIsCorrect() throws Exception { try { - SearchBuilder.buildFromFile("src/test/examples/indexing_invalid_expression.sd"); + SchemaBuilder.buildFromFile("src/test/examples/indexing_invalid_expression.sd"); } catch (ParseException e) { if (!e.getMessage().contains("at line 5, column 57.")) { throw e; diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/MultipleSummariesTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/MultipleSummariesTestCase.java index 181f12083c4..41321b5c81e 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/MultipleSummariesTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/MultipleSummariesTestCase.java @@ -14,6 +14,6 @@ import java.io.IOException; public class MultipleSummariesTestCase extends AbstractSchemaTestCase { @Test public void testArrayImporting() throws IOException, ParseException { - SearchBuilder.buildFromFile("src/test/examples/multiplesummaries.sd"); + SchemaBuilder.buildFromFile("src/test/examples/multiplesummaries.sd"); } } diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/NameFieldCheckTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/NameFieldCheckTestCase.java index 46da671d860..fc94bbe8731 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/NameFieldCheckTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/NameFieldCheckTestCase.java @@ -19,7 +19,7 @@ public class NameFieldCheckTestCase extends AbstractSchemaTestCase { @Test public void testNameField() { try { - SearchBuilder.createFromString( + SchemaBuilder.createFromString( "search simple {\n" + " document name-check {\n" + " field title type string {\n" + @@ -40,7 +40,7 @@ public class NameFieldCheckTestCase extends AbstractSchemaTestCase { @Test public void testDuplicateNamesInSearchDifferentType() { try { - SearchBuilder.createFromString( + SchemaBuilder.createFromString( "search duplicatenamesinsearch {\n" + " document {\n" + " field grpphotoids64 type string { }\n" + @@ -60,7 +60,7 @@ public class NameFieldCheckTestCase extends AbstractSchemaTestCase { @Test public void testDuplicateNamesInDoc() { try { - SearchBuilder.createFromString( + SchemaBuilder.createFromString( "search duplicatenamesindoc {\n" + " document {\n" + " field foo type int {\n" + diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/OutsideTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/OutsideTestCase.java index fda1f184a62..5663473481b 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/OutsideTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/OutsideTestCase.java @@ -17,7 +17,7 @@ public class OutsideTestCase extends AbstractSchemaTestCase { @Test public void testOutsideIndex() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/outsidedoc.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/outsidedoc.sd"); Index defaultIndex= schema.getIndex("default"); assertTrue(defaultIndex.isPrefix()); @@ -26,7 +26,7 @@ public class OutsideTestCase extends AbstractSchemaTestCase { @Test public void testOutsideSummary() throws IOException, ParseException { - SearchBuilder.buildFromFile("src/test/examples/outsidesummary.sd"); + SchemaBuilder.buildFromFile("src/test/examples/outsidesummary.sd"); } } diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/PredicateDataTypeTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/PredicateDataTypeTestCase.java index e5afb481b80..a3dd45a629f 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/PredicateDataTypeTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/PredicateDataTypeTestCase.java @@ -64,8 +64,8 @@ public class PredicateDataTypeTestCase { lowerBoundParameter(lowerBound) + upperBoundParameter(upperBound)))); - SearchBuilder sb = SearchBuilder.createFromString(sd); - for (ImmutableSDField field : sb.getSearch().allConcreteFields()) { + SchemaBuilder sb = SchemaBuilder.createFromString(sd); + for (ImmutableSDField field : sb.getSchema().allConcreteFields()) { if (field.getDataType() == DataType.PREDICATE) { for (Index index : field.getIndices().values()) { assertTrue(index.getBooleanIndexDefiniton().hasArity()); @@ -91,8 +91,8 @@ public class PredicateDataTypeTestCase { "lower-bound: -100000000000000000L\n" + // +'L' upperBoundParameter(upperBound)))); - SearchBuilder sb = SearchBuilder.createFromString(sd); - for (ImmutableSDField field : sb.getSearch().allConcreteFields()) { + SchemaBuilder sb = SchemaBuilder.createFromString(sd); + for (ImmutableSDField field : sb.getSchema().allConcreteFields()) { if (field.getDataType() == DataType.PREDICATE) { for (Index index : field.getIndices().values()) { assertEquals(arity, index.getBooleanIndexDefiniton().getArity()); @@ -109,8 +109,8 @@ public class PredicateDataTypeTestCase { predicateFieldSd( attributeFieldSd( arityParameter(2)))); - SearchBuilder sb = SearchBuilder.createFromString(sd); - for (ImmutableSDField field : sb.getSearch().allConcreteFields()) { + SchemaBuilder sb = SchemaBuilder.createFromString(sd); + for (ImmutableSDField field : sb.getSchema().allConcreteFields()) { if (field.getDataType() == DataType.PREDICATE) { for (Index index : field.getIndices().values()) { assertTrue(index.getBooleanIndexDefiniton().hasArity()); @@ -127,7 +127,7 @@ public class PredicateDataTypeTestCase { exception.expect(IllegalArgumentException.class); exception.expectMessage("Missing arity value in predicate field."); - SearchBuilder.createFromString(sd); + SchemaBuilder.createFromString(sd); fail(); } @@ -137,7 +137,7 @@ public class PredicateDataTypeTestCase { exception.expect(IllegalArgumentException.class); exception.expectMessage("For schema 'p', field 'pf': Use 'attribute' instead of 'index'. This will require a refeed if you have upgraded."); - SearchBuilder.createFromString(sd); + SchemaBuilder.createFromString(sd); } @Test @@ -146,7 +146,7 @@ public class PredicateDataTypeTestCase { exception.expect(IllegalArgumentException.class); exception.expectMessage("For schema 'p', field 'pf': Use 'attribute' instead of 'index'. This will require a refeed if you have upgraded."); - SearchBuilder.createFromString(sd); + SchemaBuilder.createFromString(sd); } @@ -156,7 +156,7 @@ public class PredicateDataTypeTestCase { exception.expect(IllegalArgumentException.class); exception.expectMessage("Invalid arity value in predicate field, must be greater than 1."); - SearchBuilder.createFromString(sd); + SchemaBuilder.createFromString(sd); } @Test @@ -165,7 +165,7 @@ public class PredicateDataTypeTestCase { exception.expect(IllegalArgumentException.class); exception.expectMessage("Arity parameter is used only for predicate type fields."); - SearchBuilder.createFromString(sd); + SchemaBuilder.createFromString(sd); } @Test @@ -177,7 +177,7 @@ public class PredicateDataTypeTestCase { exception.expect(IllegalArgumentException.class); exception.expectMessage("Parameters lower-bound and upper-bound are used only for predicate type fields."); - SearchBuilder.createFromString(sd); + SchemaBuilder.createFromString(sd); } @Test @@ -189,7 +189,7 @@ public class PredicateDataTypeTestCase { exception.expect(IllegalArgumentException.class); exception.expectMessage("Collections of predicates are not allowed."); - SearchBuilder.createFromString(sd); + SchemaBuilder.createFromString(sd); } } diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/RankProfileTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/RankProfileTestCase.java index 857da3068cd..3fa129eae39 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/RankProfileTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/RankProfileTestCase.java @@ -69,7 +69,7 @@ public class RankProfileTestCase extends AbstractSchemaTestCase { public void requireThatIllegalInheritanceIsChecked() throws ParseException { try { RankProfileRegistry registry = new RankProfileRegistry(); - SearchBuilder builder = new SearchBuilder(registry, setupQueryProfileTypes()); + SchemaBuilder builder = new SchemaBuilder(registry, setupQueryProfileTypes()); builder.importString(joinLines( "search test {", " document test { } ", @@ -86,7 +86,7 @@ public class RankProfileTestCase extends AbstractSchemaTestCase { public void requireThatSelfInheritanceIsIllegal() throws ParseException { try { RankProfileRegistry registry = new RankProfileRegistry(); - SearchBuilder builder = new SearchBuilder(registry, setupQueryProfileTypes()); + SchemaBuilder builder = new SchemaBuilder(registry, setupQueryProfileTypes()); builder.importString(joinLines( "schema test {", " document test { } ", @@ -102,7 +102,7 @@ public class RankProfileTestCase extends AbstractSchemaTestCase { @Test public void requireThatSelfInheritanceIsLegalWhenOverloading() throws ParseException { RankProfileRegistry registry = new RankProfileRegistry(); - SearchBuilder builder = new SearchBuilder(registry, setupQueryProfileTypes()); + SchemaBuilder builder = new SchemaBuilder(registry, setupQueryProfileTypes()); builder.importString(joinLines( "schema base {", " document base { } ", @@ -119,7 +119,7 @@ public class RankProfileTestCase extends AbstractSchemaTestCase { @Test public void requireThatSidewaysInheritanceIsImpossible() throws ParseException { RankProfileRegistry registry = new RankProfileRegistry(); - SearchBuilder builder = new SearchBuilder(registry, setupQueryProfileTypes()); + SchemaBuilder builder = new SchemaBuilder(registry, setupQueryProfileTypes()); builder.importString(joinLines( "schema child1 {", " document child1 {", @@ -172,7 +172,7 @@ public class RankProfileTestCase extends AbstractSchemaTestCase { @Test public void requireThatDefaultCanAlwaysBeInherited() throws ParseException { RankProfileRegistry registry = new RankProfileRegistry(); - SearchBuilder builder = new SearchBuilder(registry, setupQueryProfileTypes()); + SchemaBuilder builder = new SchemaBuilder(registry, setupQueryProfileTypes()); builder.importString(joinLines( "schema test {", " document test { } ", @@ -185,7 +185,7 @@ public class RankProfileTestCase extends AbstractSchemaTestCase { public void requireThatCyclicInheritanceIsIllegal() throws ParseException { try { RankProfileRegistry registry = new RankProfileRegistry(); - SearchBuilder builder = new SearchBuilder(registry, setupQueryProfileTypes()); + SchemaBuilder builder = new SchemaBuilder(registry, setupQueryProfileTypes()); builder.importString(joinLines( "search test {", " document test { } ", @@ -204,7 +204,7 @@ public class RankProfileTestCase extends AbstractSchemaTestCase { public void requireThatRankProfilesCanInheritNotYetSeenProfiles() throws ParseException { RankProfileRegistry registry = new RankProfileRegistry(); - SearchBuilder builder = new SearchBuilder(registry, setupQueryProfileTypes()); + SchemaBuilder builder = new SchemaBuilder(registry, setupQueryProfileTypes()); builder.importString(joinLines( "search test {", " document test { } ", @@ -246,10 +246,10 @@ public class RankProfileTestCase extends AbstractSchemaTestCase { private void verifyTermwiseLimitAndSomeMoreIncludingInheritance(ModelContext.Properties deployProperties, String sd, Double termwiseLimit) throws ParseException { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder builder = new SearchBuilder(rankProfileRegistry); + SchemaBuilder builder = new SchemaBuilder(rankProfileRegistry); builder.importString(sd); builder.build(); - Schema schema = builder.getSearch(); + Schema schema = builder.getSchema(); AttributeFields attributeFields = new AttributeFields(schema); verifyRankProfile(rankProfileRegistry.get(schema, "parent"), attributeFields, deployProperties, termwiseLimit); verifyRankProfile(rankProfileRegistry.get(schema, "child"), attributeFields, deployProperties, termwiseLimit); @@ -279,7 +279,7 @@ public class RankProfileTestCase extends AbstractSchemaTestCase { @Test public void requireThatConfigIsDerivedForAttributeTypeSettings() throws ParseException { RankProfileRegistry registry = new RankProfileRegistry(); - SearchBuilder builder = new SearchBuilder(registry); + SchemaBuilder builder = new SchemaBuilder(registry); builder.importString(joinLines( "search test {", " document test { ", @@ -291,7 +291,7 @@ public class RankProfileTestCase extends AbstractSchemaTestCase { " rank-profile p2 {}", "}")); builder.build(); - Schema schema = builder.getSearch(); + Schema schema = builder.getSchema(); assertEquals(4, registry.all().size()); assertAttributeTypeSettings(registry.get(schema, "default"), schema); @@ -303,7 +303,7 @@ public class RankProfileTestCase extends AbstractSchemaTestCase { @Test public void requireThatDenseDimensionsMustBeBound() throws ParseException { try { - SearchBuilder builder = new SearchBuilder(new RankProfileRegistry()); + SchemaBuilder builder = new SchemaBuilder(new RankProfileRegistry()); builder.importString(joinLines( "search test {", " document test { ", @@ -332,7 +332,7 @@ public class RankProfileTestCase extends AbstractSchemaTestCase { @Test public void requireThatConfigIsDerivedForQueryFeatureTypeSettings() throws ParseException { RankProfileRegistry registry = new RankProfileRegistry(); - SearchBuilder builder = new SearchBuilder(registry, setupQueryProfileTypes()); + SchemaBuilder builder = new SchemaBuilder(registry, setupQueryProfileTypes()); builder.importString(joinLines( "search test {", " document test { } ", @@ -340,7 +340,7 @@ public class RankProfileTestCase extends AbstractSchemaTestCase { " rank-profile p2 {}", "}")); builder.build(true); - Schema schema = builder.getSearch(); + Schema schema = builder.getSchema(); assertEquals(4, registry.all().size()); assertQueryFeatureTypeSettings(registry.get(schema, "default"), schema); 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 637f7571a68..20fd5444477 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/RankPropertiesTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/RankPropertiesTestCase.java @@ -23,7 +23,7 @@ public class RankPropertiesTestCase extends AbstractSchemaTestCase { @Test public void testRankPropertyInheritance() throws ParseException { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder builder = new SearchBuilder(rankProfileRegistry); + SchemaBuilder builder = new SchemaBuilder(rankProfileRegistry); builder.importString(joinLines( "search test {", " document test {", @@ -49,7 +49,7 @@ public class RankPropertiesTestCase extends AbstractSchemaTestCase { " }", "}")); builder.build(); - Schema schema = builder.getSearch(); + Schema schema = builder.getSchema(); AttributeFields attributeFields = new AttributeFields(schema); { @@ -80,7 +80,7 @@ public class RankPropertiesTestCase extends AbstractSchemaTestCase { @Test public void testRankProfileMutate() throws ParseException { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder builder = new SearchBuilder(rankProfileRegistry); + SchemaBuilder builder = new SchemaBuilder(rankProfileRegistry); builder.importString(joinLines( "search test {", " document test {", @@ -129,7 +129,7 @@ public class RankPropertiesTestCase extends AbstractSchemaTestCase { " }", "}")); builder.build(); - Schema schema = builder.getSearch(); + Schema schema = builder.getSchema(); RankProfile a = rankProfileRegistry.get(schema, "a"); List<RankProfile.MutateOperation> operations = a.getMutateOperations(); assertEquals(4, operations.size()); diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/RankingConstantTest.java b/config-model/src/test/java/com/yahoo/searchdefinition/RankingConstantTest.java index 8bfd9c898e4..7951962a8bd 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/RankingConstantTest.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/RankingConstantTest.java @@ -27,8 +27,8 @@ public class RankingConstantTest { final String TENSOR_FILE = "path/my-tensor-file.json"; final String TENSOR_TYPE = "tensor(x{})"; RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder searchBuilder = new SearchBuilder(rankProfileRegistry); - searchBuilder.importString(joinLines( + SchemaBuilder schemaBuilder = new SchemaBuilder(rankProfileRegistry); + schemaBuilder.importString(joinLines( "search test {", " document test { }", " rank-profile my_rank_profile {", @@ -42,8 +42,8 @@ public class RankingConstantTest { " }", "}" )); - searchBuilder.build(); - Schema schema = searchBuilder.getSearch(); + schemaBuilder.build(); + Schema schema = schemaBuilder.getSchema(); Iterator<RankingConstant> constantIterator = schema.rankingConstants().asMap().values().iterator(); RankingConstant constant = constantIterator.next(); @@ -58,10 +58,10 @@ public class RankingConstantTest { @Test public void tensor_constant_must_have_a_type() throws Exception { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder searchBuilder = new SearchBuilder(rankProfileRegistry); + SchemaBuilder schemaBuilder = new SchemaBuilder(rankProfileRegistry); thrown.expect(IllegalArgumentException.class); thrown.expectMessage("must have a type"); - searchBuilder.importString(joinLines( + schemaBuilder.importString(joinLines( "search test {", " document test { }", " constant foo {", @@ -74,10 +74,10 @@ public class RankingConstantTest { @Test public void tensor_constant_must_have_a_file() throws Exception { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder searchBuilder = new SearchBuilder(rankProfileRegistry); + SchemaBuilder schemaBuilder = new SchemaBuilder(rankProfileRegistry); thrown.expect(IllegalArgumentException.class); thrown.expectMessage("must have a file"); - searchBuilder.importString(joinLines( + schemaBuilder.importString(joinLines( "search test {", " document test { }", " constant foo {", @@ -90,8 +90,8 @@ public class RankingConstantTest { @Test public void constant_file_does_not_need_path_or_ending() throws Exception { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder searchBuilder = new SearchBuilder(rankProfileRegistry); - searchBuilder.importString(joinLines( + SchemaBuilder schemaBuilder = new SchemaBuilder(rankProfileRegistry); + schemaBuilder.importString(joinLines( "search test {", " document test { }", " constant foo {", @@ -100,8 +100,8 @@ public class RankingConstantTest { " }", "}" )); - searchBuilder.build(); - Schema schema = searchBuilder.getSearch(); + schemaBuilder.build(); + Schema schema = schemaBuilder.getSchema(); RankingConstant constant = schema.rankingConstants().asMap().values().iterator().next(); assertEquals("simplename", constant.getFileName()); } @@ -109,8 +109,8 @@ public class RankingConstantTest { @Test public void constant_uri_is_allowed() throws Exception { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder searchBuilder = new SearchBuilder(rankProfileRegistry); - searchBuilder.importString(joinLines( + SchemaBuilder schemaBuilder = new SchemaBuilder(rankProfileRegistry); + schemaBuilder.importString(joinLines( "search test {", " document test { }", " constant foo {", @@ -119,8 +119,8 @@ public class RankingConstantTest { " }", "}" )); - searchBuilder.build(); - Schema schema = searchBuilder.getSearch(); + schemaBuilder.build(); + Schema schema = schemaBuilder.getSchema(); RankingConstant constant = schema.rankingConstants().asMap().values().iterator().next(); assertEquals(RankingConstant.PathType.URI, constant.getPathType()); assertEquals("http://somewhere.far.away/in/another-galaxy", constant.getUri()); @@ -129,8 +129,8 @@ public class RankingConstantTest { @Test public void constant_https_uri_is_allowed() throws Exception { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder searchBuilder = new SearchBuilder(rankProfileRegistry); - searchBuilder.importString(joinLines( + SchemaBuilder schemaBuilder = new SchemaBuilder(rankProfileRegistry); + schemaBuilder.importString(joinLines( "search test {", " document test { }", " constant foo {", @@ -139,8 +139,8 @@ public class RankingConstantTest { " }", "}" )); - searchBuilder.build(); - Schema schema = searchBuilder.getSearch(); + schemaBuilder.build(); + Schema schema = schemaBuilder.getSchema(); RankingConstant constant = schema.rankingConstants().asMap().values().iterator().next(); assertEquals(RankingConstant.PathType.URI, constant.getPathType()); assertEquals("https://somewhere.far.away:4443/in/another-galaxy", constant.getUri()); @@ -149,8 +149,8 @@ public class RankingConstantTest { @Test public void constant_uri_with_port_is_allowed() throws Exception { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder searchBuilder = new SearchBuilder(rankProfileRegistry); - searchBuilder.importString(joinLines( + SchemaBuilder schemaBuilder = new SchemaBuilder(rankProfileRegistry); + schemaBuilder.importString(joinLines( "search test {", " document test { }", " constant foo {", @@ -159,8 +159,8 @@ public class RankingConstantTest { " }", "}" )); - searchBuilder.build(); - Schema schema = searchBuilder.getSearch(); + schemaBuilder.build(); + Schema schema = schemaBuilder.getSchema(); RankingConstant constant = schema.rankingConstants().asMap().values().iterator().next(); assertEquals(RankingConstant.PathType.URI, constant.getPathType()); assertEquals("http://somewhere.far.away:4080/in/another-galaxy", constant.getUri()); @@ -169,8 +169,8 @@ public class RankingConstantTest { @Test public void constant_uri_no_dual_slashes_is_allowed() throws Exception { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder searchBuilder = new SearchBuilder(rankProfileRegistry); - searchBuilder.importString(joinLines( + SchemaBuilder schemaBuilder = new SchemaBuilder(rankProfileRegistry); + schemaBuilder.importString(joinLines( "search test {", " document test { }", " constant foo {", @@ -179,8 +179,8 @@ public class RankingConstantTest { " }", "}" )); - searchBuilder.build(); - Schema schema = searchBuilder.getSearch(); + schemaBuilder.build(); + Schema schema = schemaBuilder.getSchema(); RankingConstant constant = schema.rankingConstants().asMap().values().iterator().next(); assertEquals(RankingConstant.PathType.URI, constant.getPathType()); assertEquals("http:somewhere.far.away/in/another-galaxy", constant.getUri()); @@ -189,12 +189,12 @@ public class RankingConstantTest { @Test public void constant_uri_only_supports_http_and_https() { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder searchBuilder = new SearchBuilder(rankProfileRegistry); + SchemaBuilder schemaBuilder = new SchemaBuilder(rankProfileRegistry); String expectedMessage = "Encountered \" <IDENTIFIER> \"ftp\"\" at line 5, column 10.\n\n" + "Was expecting:\n\n" + "<URI_PATH> ..."; try { - searchBuilder.importString(joinLines( + schemaBuilder.importString(joinLines( "search test {", " document test { }", " constant foo {", diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/RankingExpressionConstantsTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/RankingExpressionConstantsTestCase.java index 19a50817f75..678c2301bc6 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/RankingExpressionConstantsTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/RankingExpressionConstantsTestCase.java @@ -25,7 +25,7 @@ public class RankingExpressionConstantsTestCase extends AbstractSchemaTestCase { public void testConstants() throws ParseException { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); QueryProfileRegistry queryProfileRegistry = new QueryProfileRegistry(); - SearchBuilder builder = new SearchBuilder(rankProfileRegistry); + SchemaBuilder builder = new SchemaBuilder(rankProfileRegistry); builder.importString( "search test {\n" + " document test { \n" + @@ -67,7 +67,7 @@ public class RankingExpressionConstantsTestCase extends AbstractSchemaTestCase { "\n" + "}\n"); builder.build(); - Schema s = builder.getSearch(); + Schema s = builder.getSchema(); RankProfile parent = rankProfileRegistry.get(s, "parent").compile(queryProfileRegistry, new ImportedMlModels()); assertEquals("0.0", parent.getFirstPhaseRanking().getRoot().toString()); @@ -91,7 +91,7 @@ public class RankingExpressionConstantsTestCase extends AbstractSchemaTestCase { @Test public void testNameCollision() throws ParseException { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder builder = new SearchBuilder(rankProfileRegistry); + SchemaBuilder builder = new SchemaBuilder(rankProfileRegistry); builder.importString( "search test {\n" + " document test { \n" + @@ -111,7 +111,7 @@ public class RankingExpressionConstantsTestCase extends AbstractSchemaTestCase { "\n" + "}\n"); builder.build(); - Schema s = builder.getSearch(); + Schema s = builder.getSchema(); try { rankProfileRegistry.get(s, "test").compile(new QueryProfileRegistry(), new ImportedMlModels()); fail("Should have caused an exception"); @@ -125,7 +125,7 @@ public class RankingExpressionConstantsTestCase extends AbstractSchemaTestCase { @Test public void testNegativeLiteralArgument() throws ParseException { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder builder = new SearchBuilder(rankProfileRegistry); + SchemaBuilder builder = new SchemaBuilder(rankProfileRegistry); builder.importString( "search test {\n" + " document test { \n" + @@ -142,7 +142,7 @@ public class RankingExpressionConstantsTestCase extends AbstractSchemaTestCase { "\n" + "}\n"); builder.build(); - Schema s = builder.getSearch(); + Schema s = builder.getSchema(); RankProfile profile = rankProfileRegistry.get(s, "test"); assertEquals("safeLog(popShareSlowDecaySignal,-9.21034037)", profile.getFunctions().get("POP_SLOW_SCORE").function().getBody().getRoot().toString()); } @@ -150,7 +150,7 @@ public class RankingExpressionConstantsTestCase extends AbstractSchemaTestCase { @Test public void testNegativeConstantArgument() throws ParseException { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder builder = new SearchBuilder(rankProfileRegistry); + SchemaBuilder builder = new SchemaBuilder(rankProfileRegistry); builder.importString( "search test {\n" + " document test { \n" + @@ -170,7 +170,7 @@ public class RankingExpressionConstantsTestCase extends AbstractSchemaTestCase { "\n" + "}\n"); builder.build(); - Schema s = builder.getSearch(); + Schema s = builder.getSchema(); RankProfile profile = rankProfileRegistry.get(s, "test"); assertEquals("safeLog(popShareSlowDecaySignal,myValue)", profile.getFunctions().get("POP_SLOW_SCORE").function().getBody().getRoot().toString()); assertEquals("safeLog(popShareSlowDecaySignal,-9.21034037)", @@ -180,7 +180,7 @@ public class RankingExpressionConstantsTestCase extends AbstractSchemaTestCase { @Test public void testConstantDivisorInFunction() throws ParseException { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder builder = new SearchBuilder(rankProfileRegistry); + SchemaBuilder builder = new SchemaBuilder(rankProfileRegistry); builder.importString( "search test {\n" + " document test { \n" + @@ -194,7 +194,7 @@ public class RankingExpressionConstantsTestCase extends AbstractSchemaTestCase { "\n" + "}\n"); builder.build(); - Schema s = builder.getSearch(); + Schema s = builder.getSchema(); RankProfile profile = rankProfileRegistry.get(s, "test"); assertEquals("k1 + (k2 + k3) / 100000000.0", profile.compile(new QueryProfileRegistry(), new ImportedMlModels()).getFunctions().get("rank_default").function().getBody().getRoot().toString()); @@ -203,7 +203,7 @@ public class RankingExpressionConstantsTestCase extends AbstractSchemaTestCase { @Test public void test3() throws ParseException { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder builder = new SearchBuilder(rankProfileRegistry); + SchemaBuilder builder = new SchemaBuilder(rankProfileRegistry); builder.importString( "search test {\n" + " document test { \n" + @@ -220,7 +220,7 @@ public class RankingExpressionConstantsTestCase extends AbstractSchemaTestCase { "\n" + "}\n"); builder.build(); - Schema s = builder.getSearch(); + Schema s = builder.getSchema(); RankProfile profile = rankProfileRegistry.get(s, "test"); assertEquals("0.5 + 50 * (attribute(rating_yelp) - 3)", profile.compile(new QueryProfileRegistry(), new ImportedMlModels()).getFunctions().get("rank_default").function().getBody().getRoot().toString()); diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/RankingExpressionInliningTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/RankingExpressionInliningTestCase.java index 238e71a6340..50c94ff38d4 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/RankingExpressionInliningTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/RankingExpressionInliningTestCase.java @@ -28,7 +28,7 @@ public class RankingExpressionInliningTestCase extends AbstractSchemaTestCase { @Test public void testFunctionInliningPreserveArithmeticOrdering() throws ParseException { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder builder = new SearchBuilder(rankProfileRegistry); + SchemaBuilder builder = new SchemaBuilder(rankProfileRegistry); builder.importString( "search test {\n" + " document test { \n" + @@ -66,7 +66,7 @@ public class RankingExpressionInliningTestCase extends AbstractSchemaTestCase { "\n" + "}\n"); builder.build(); - Schema s = builder.getSearch(); + Schema s = builder.getSchema(); RankProfile parent = rankProfileRegistry.get(s, "parent").compile(new QueryProfileRegistry(), new ImportedMlModels()); assertEquals("7.0 * (3 + attribute(a) + attribute(b) * (attribute(a) * 3 + if (7.0 < attribute(a), 1, 2) == 0))", @@ -79,7 +79,7 @@ public class RankingExpressionInliningTestCase extends AbstractSchemaTestCase { @Test public void testConstants() throws ParseException { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder builder = new SearchBuilder(rankProfileRegistry); + SchemaBuilder builder = new SchemaBuilder(rankProfileRegistry); builder.importString( "search test {\n" + " document test { \n" + @@ -126,7 +126,7 @@ public class RankingExpressionInliningTestCase extends AbstractSchemaTestCase { "\n" + "}\n"); builder.build(); - Schema s = builder.getSearch(); + Schema s = builder.getSchema(); RankProfile parent = rankProfileRegistry.get(s, "parent").compile(new QueryProfileRegistry(), new ImportedMlModels()); assertEquals("17.0", parent.getFirstPhaseRanking().getRoot().toString()); @@ -150,7 +150,7 @@ public class RankingExpressionInliningTestCase extends AbstractSchemaTestCase { @Test public void testNonTopLevelInlining() throws ParseException { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder builder = new SearchBuilder(rankProfileRegistry); + SchemaBuilder builder = new SchemaBuilder(rankProfileRegistry); builder.importString( "search test {\n" + " document test { \n" + @@ -182,7 +182,7 @@ public class RankingExpressionInliningTestCase extends AbstractSchemaTestCase { "\n" + "}\n"); builder.build(); - Schema s = builder.getSearch(); + Schema s = builder.getSchema(); RankProfile test = rankProfileRegistry.get(s, "test").compile(new QueryProfileRegistry(), new ImportedMlModels()); assertEquals("attribute(a) + C + (attribute(b) + 1)", test.getFirstPhaseRanking().getRoot().toString()); @@ -194,7 +194,7 @@ public class RankingExpressionInliningTestCase extends AbstractSchemaTestCase { public void testFunctionInliningWithReplacement() throws ParseException { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); MockDeployLogger deployLogger = new MockDeployLogger(); - SearchBuilder builder = new SearchBuilder(MockApplicationPackage.createEmpty(), + SchemaBuilder builder = new SchemaBuilder(MockApplicationPackage.createEmpty(), new MockFileRegistry(), deployLogger, new TestProperties(), @@ -216,7 +216,7 @@ public class RankingExpressionInliningTestCase extends AbstractSchemaTestCase { " }\n" + "}\n"); builder.build(); - Schema s = builder.getSearch(); + Schema s = builder.getSchema(); RankProfile test = rankProfileRegistry.get(s, "test").compile(new QueryProfileRegistry(), new ImportedMlModels()); assertEquals("foo(2)", test.getFirstPhaseRanking().getRoot().toString()); assertTrue("Does not contain expected warning", deployLogger.contains("Function 'foo' replaces " + diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/RankingExpressionLoopDetectionTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/RankingExpressionLoopDetectionTestCase.java index fff5c2023b9..689b75690ae 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/RankingExpressionLoopDetectionTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/RankingExpressionLoopDetectionTestCase.java @@ -16,7 +16,7 @@ public class RankingExpressionLoopDetectionTestCase { @Test public void testSelfLoop() throws ParseException { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder builder = new SearchBuilder(rankProfileRegistry); + SchemaBuilder builder = new SchemaBuilder(rankProfileRegistry); builder.importString( "search test {\n" + " document test { \n" + @@ -48,7 +48,7 @@ public class RankingExpressionLoopDetectionTestCase { @Test public void testNestedLoop() throws ParseException { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder builder = new SearchBuilder(rankProfileRegistry); + SchemaBuilder builder = new SchemaBuilder(rankProfileRegistry); builder.importString( "search test {\n" + " document test { \n" + @@ -83,7 +83,7 @@ public class RankingExpressionLoopDetectionTestCase { @Test public void testSelfArgumentLoop() throws ParseException { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder builder = new SearchBuilder(rankProfileRegistry); + SchemaBuilder builder = new SchemaBuilder(rankProfileRegistry); builder.importString( "search test {\n" + " document test { \n" + @@ -118,7 +118,7 @@ public class RankingExpressionLoopDetectionTestCase { @Test public void testNoLoopWithSameLocalArgument() throws ParseException { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder builder = new SearchBuilder(rankProfileRegistry); + SchemaBuilder builder = new SchemaBuilder(rankProfileRegistry); builder.importString( "search test {\n" + " document test { \n" + @@ -146,7 +146,7 @@ public class RankingExpressionLoopDetectionTestCase { @Test public void testNoLoopWithMultipleInvocations() throws ParseException { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder builder = new SearchBuilder(rankProfileRegistry); + SchemaBuilder builder = new SchemaBuilder(rankProfileRegistry); builder.importString( "search test {\n" + " document test { \n" + @@ -174,7 +174,7 @@ public class RankingExpressionLoopDetectionTestCase { @Test public void testNoLoopWithBoundIdentifiers() throws ParseException { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder builder = new SearchBuilder(rankProfileRegistry); + SchemaBuilder builder = new SchemaBuilder(rankProfileRegistry); builder.importString( "search test {\n" + " document test { \n" + @@ -197,7 +197,7 @@ public class RankingExpressionLoopDetectionTestCase { @Test public void testNoLoopWithTheSameNestedIdentifierWhichIsUnbound() throws ParseException { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder builder = new SearchBuilder(rankProfileRegistry); + SchemaBuilder builder = new SchemaBuilder(rankProfileRegistry); builder.importString( "search test {\n" + " document test { \n" + @@ -220,7 +220,7 @@ public class RankingExpressionLoopDetectionTestCase { @Test public void testNoLoopWithTheSameAlternatingNestedIdentifierWhichIsUnbound() throws ParseException { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder builder = new SearchBuilder(rankProfileRegistry); + SchemaBuilder builder = new SchemaBuilder(rankProfileRegistry); builder.importString( "search test {\n" + " document test { \n" + diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/RankingExpressionShadowingTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/RankingExpressionShadowingTestCase.java index 231fa531770..ff146fedd88 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/RankingExpressionShadowingTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/RankingExpressionShadowingTestCase.java @@ -26,7 +26,7 @@ public class RankingExpressionShadowingTestCase extends AbstractSchemaTestCase { @Test public void testBasicFunctionShadowing() throws ParseException { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder builder = new SearchBuilder(rankProfileRegistry); + SchemaBuilder builder = new SchemaBuilder(rankProfileRegistry); builder.importString( "search test {\n" + " document test { \n" + @@ -46,7 +46,7 @@ public class RankingExpressionShadowingTestCase extends AbstractSchemaTestCase { "\n" + "}\n"); builder.build(); - Schema s = builder.getSearch(); + Schema s = builder.getSchema(); RankProfile test = rankProfileRegistry.get(s, "test").compile(new QueryProfileRegistry(), new ImportedMlModels()); List<Pair<String, String>> testRankProperties = createRawRankProfile(test, new QueryProfileRegistry(), s).configProperties(); assertEquals("(rankingExpression(sin@).rankingScript, 2 * 2)", @@ -61,7 +61,7 @@ public class RankingExpressionShadowingTestCase extends AbstractSchemaTestCase { @Test public void testMultiLevelFunctionShadowing() throws ParseException { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder builder = new SearchBuilder(rankProfileRegistry); + SchemaBuilder builder = new SchemaBuilder(rankProfileRegistry); builder.importString( "search test {\n" + " document test { \n" + @@ -87,7 +87,7 @@ public class RankingExpressionShadowingTestCase extends AbstractSchemaTestCase { "\n" + "}\n"); builder.build(); - Schema s = builder.getSearch(); + Schema s = builder.getSchema(); RankProfile test = rankProfileRegistry.get(s, "test").compile(new QueryProfileRegistry(), new ImportedMlModels()); List<Pair<String, String>> testRankProperties = createRawRankProfile(test, new QueryProfileRegistry(), s).configProperties(); assertEquals("(rankingExpression(tan@).rankingScript, 2 * 2)", @@ -113,7 +113,7 @@ public class RankingExpressionShadowingTestCase extends AbstractSchemaTestCase { @Test public void testFunctionShadowingArguments() throws ParseException { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder builder = new SearchBuilder(rankProfileRegistry); + SchemaBuilder builder = new SchemaBuilder(rankProfileRegistry); builder.importString( "search test {\n" + " document test { \n" + @@ -133,7 +133,7 @@ public class RankingExpressionShadowingTestCase extends AbstractSchemaTestCase { "\n" + "}\n"); builder.build(); - Schema s = builder.getSearch(); + Schema s = builder.getSchema(); RankProfile test = rankProfileRegistry.get(s, "test").compile(new QueryProfileRegistry(), new ImportedMlModels()); List<Pair<String, String>> testRankProperties = createRawRankProfile(test, new QueryProfileRegistry(), s).configProperties(); assertEquals("(rankingExpression(sin@).rankingScript, 4.0 * 4.0)", @@ -153,7 +153,7 @@ public class RankingExpressionShadowingTestCase extends AbstractSchemaTestCase { // Note: the type assigned to query profile and constant tensors here is not the correct type RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); QueryProfileRegistry queryProfiles = queryProfileWith("query(q)", "tensor(input[1])"); - SearchBuilder builder = new SearchBuilder(rankProfileRegistry, queryProfiles); + SchemaBuilder builder = new SchemaBuilder(rankProfileRegistry, queryProfiles); builder.importString( "search test {\n" + " document test { \n" + @@ -194,7 +194,7 @@ public class RankingExpressionShadowingTestCase extends AbstractSchemaTestCase { " }\n" + "}\n"); builder.build(); - Schema s = builder.getSearch(); + Schema s = builder.getSchema(); RankProfile test = rankProfileRegistry.get(s, "test").compile(queryProfiles, new ImportedMlModels()); List<Pair<String, String>> testRankProperties = createRawRankProfile(test, queryProfiles, s).configProperties(); assertEquals("(rankingExpression(autogenerated_ranking_feature@).rankingScript, reduce(query(q) * constant(W_hidden), sum, input) + constant(b_input))", diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/RankingExpressionValidationTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/RankingExpressionValidationTestCase.java index a66a4cd8648..299724ea39e 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/RankingExpressionValidationTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/RankingExpressionValidationTestCase.java @@ -32,7 +32,7 @@ public class RankingExpressionValidationTestCase extends AbstractSchemaTestCase } private Schema importWithExpression(String expression, RankProfileRegistry registry) throws ParseException { - SearchBuilder builder = new SearchBuilder(registry); + SchemaBuilder builder = new SchemaBuilder(registry); builder.importString("search test {" + " document test { " + " field a type string { " + @@ -46,7 +46,7 @@ public class RankingExpressionValidationTestCase extends AbstractSchemaTestCase " }" + "}"); builder.build(); - return builder.getSearch(); + return builder.getSchema(); } } diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/ReservedWordsAsFieldNamesTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/ReservedWordsAsFieldNamesTestCase.java index f893f532f09..a6f76897c0b 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/ReservedWordsAsFieldNamesTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/ReservedWordsAsFieldNamesTestCase.java @@ -15,7 +15,7 @@ public class ReservedWordsAsFieldNamesTestCase extends AbstractSchemaTestCase { @Test public void testIt() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/reserved_words_as_field_names.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/reserved_words_as_field_names.sd"); assertNotNull(schema.getDocument().getField("inline")); assertNotNull(schema.getDocument().getField("constants")); assertNotNull(schema.getDocument().getField("reference")); diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/SchemaImporterTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/SchemaImporterTestCase.java index 1ae44e30c32..c2816336076 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/SchemaImporterTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/SchemaImporterTestCase.java @@ -36,10 +36,10 @@ public class SchemaImporterTestCase extends AbstractSchemaTestCase { @SuppressWarnings("deprecation") public void testSimpleImporting() throws IOException, ParseException { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder sb = new SearchBuilder(rankProfileRegistry, new QueryProfileRegistry()); + SchemaBuilder sb = new SchemaBuilder(rankProfileRegistry, new QueryProfileRegistry()); sb.importFile("src/test/examples/simple.sd"); sb.build(); - Schema schema = sb.getSearch(); + Schema schema = sb.getSchema(); assertEquals("simple", schema.getName()); assertTrue(schema.hasDocument()); @@ -170,7 +170,7 @@ public class SchemaImporterTestCase extends AbstractSchemaTestCase { public void testDocumentImporting() throws IOException, ParseException { try { // Having two documents in one sd-file is illegal. - SearchBuilder.buildFromFile("src/test/examples/documents.sd"); + SchemaBuilder.buildFromFile("src/test/examples/documents.sd"); fail(); } catch (IllegalArgumentException e) { } @@ -178,7 +178,7 @@ public class SchemaImporterTestCase extends AbstractSchemaTestCase { @Test public void testIdImporting() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/strange.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/strange.sd"); SDField idecidemyide=(SDField) schema.getDocument().getField("idecidemyide"); assertEquals(5,idecidemyide.getId()); SDField sodoi=(SDField) schema.getDocument().getField("sodoi"); diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/SchemaParsingTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/SchemaParsingTestCase.java index 984140be12c..dfe60c5871e 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/SchemaParsingTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/SchemaParsingTestCase.java @@ -19,13 +19,13 @@ public class SchemaParsingTestCase extends AbstractSchemaTestCase { @Test public void requireThatIndexingExpressionsCanBeParsed() throws Exception { - assertNotNull(SearchBuilder.buildFromFile("src/test/examples/simple.sd")); + assertNotNull(SchemaBuilder.buildFromFile("src/test/examples/simple.sd")); } @Test public void requireThatParseExceptionPositionIsCorrect() throws Exception { try { - SearchBuilder.buildFromFile("src/test/examples/invalid_sd_construct.sd"); + SchemaBuilder.buildFromFile("src/test/examples/invalid_sd_construct.sd"); } catch (ParseException e) { if ( ! e.getMessage().contains("at line 5, column 36.")) { throw e; @@ -36,7 +36,7 @@ public class SchemaParsingTestCase extends AbstractSchemaTestCase { @Test public void requireThatParserHandlesLexicalError() throws Exception { try { - SearchBuilder.buildFromFile("src/test/examples/invalid_sd_lexical_error.sd"); + SchemaBuilder.buildFromFile("src/test/examples/invalid_sd_lexical_error.sd"); } catch (ParseException e) { if (!e.getMessage().contains("at line 7, column 27.")) { throw e; @@ -47,7 +47,7 @@ public class SchemaParsingTestCase extends AbstractSchemaTestCase { @Test public void requireErrorWhenJunkAfterSearchBlock() throws IOException, ParseException { try { - SearchBuilder.buildFromFile("src/test/examples/invalid_sd_junk_at_end.sd"); + SchemaBuilder.buildFromFile("src/test/examples/invalid_sd_junk_at_end.sd"); fail("Illegal junk at end of SD passed"); } catch (ParseException e) { if (!e.getMessage().contains("at line 10, column 1")) { @@ -59,7 +59,7 @@ public class SchemaParsingTestCase extends AbstractSchemaTestCase { @Test public void requireErrorWhenMissingClosingSearchBracket() throws IOException, ParseException { try { - SearchBuilder.buildFromFile("src/test/examples/invalid_sd_no_closing_bracket.sd"); + SchemaBuilder.buildFromFile("src/test/examples/invalid_sd_no_closing_bracket.sd"); fail("SD without closing bracket passed"); } catch (ParseException e) { if (!e.getMessage().contains("Encountered \"<EOF>\" at line 8, column 1")) { @@ -71,7 +71,7 @@ public class SchemaParsingTestCase extends AbstractSchemaTestCase { @Test public void illegalSearchDefinitionName() throws IOException, ParseException { try { - SearchBuilder.buildFromFile("src/test/examples/invalid-name.sd"); + SchemaBuilder.buildFromFile("src/test/examples/invalid-name.sd"); fail("Name with dash passed"); } catch (ParseException e) { if ( ! e.getMessage().contains("invalid-name")) { @@ -83,7 +83,7 @@ public class SchemaParsingTestCase extends AbstractSchemaTestCase { // TODO: Remove in Vespa 8 @Test public void requireThatParserHandlesHeadAndBody() throws IOException, ParseException { - assertNotNull(SearchBuilder.buildFromFile("src/test/examples/header_body.sd")); + assertNotNull(SchemaBuilder.buildFromFile("src/test/examples/header_body.sd")); } } 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 8b96779f695..3413fe3c373 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/SchemaTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/SchemaTestCase.java @@ -30,7 +30,7 @@ public class SchemaTestCase { " }" + "}"); DeployLoggerStub logger = new DeployLoggerStub(); - SearchBuilder.createFromStrings(logger, schema); + SchemaBuilder.createFromStrings(logger, schema); assertEquals("schema 'test' inherits 'nonesuch', but this schema does not exist", logger.entries.get(0).message); fail("Expected failure"); @@ -59,7 +59,7 @@ public class SchemaTestCase { " }" + " }" + "}"); - SearchBuilder.createFromStrings(new DeployLoggerStub(), parent, child); + SchemaBuilder.createFromStrings(new DeployLoggerStub(), parent, child); } catch (IllegalArgumentException e) { assertEquals("schema 'child' inherits 'parent', " + @@ -135,7 +135,7 @@ public class SchemaTestCase { "}"); System.out.println(parentLines); - SearchBuilder builder = new SearchBuilder(new DeployLoggerStub()); + SchemaBuilder builder = new SchemaBuilder(new DeployLoggerStub()); builder.processorsToSkip().add(OnnxModelTypeResolver.class); // Avoid discovering the Onnx model referenced does not exist builder.processorsToSkip().add(ImportedFieldsResolver.class); // Avoid discovering the document reference leads nowhere builder.importString(parentLines); @@ -230,7 +230,7 @@ public class SchemaTestCase { " }" + "}"); - SearchBuilder builder = new SearchBuilder(new DeployLoggerStub()); + SchemaBuilder builder = new SchemaBuilder(new DeployLoggerStub()); builder.processorsToSkip().add(OnnxModelTypeResolver.class); // Avoid discovering the Onnx model referenced does not exist builder.processorsToSkip().add(ImportedFieldsResolver.class); // Avoid discovering the document reference leads nowhere builder.importString(parentLines); diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/StemmingSettingTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/StemmingSettingTestCase.java index d382e29ca4d..75dcd6bc209 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/StemmingSettingTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/StemmingSettingTestCase.java @@ -20,7 +20,7 @@ public class StemmingSettingTestCase extends AbstractSchemaTestCase { @Test public void testStemmingSettings() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/stemmingsetting.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/stemmingsetting.sd"); SDField artist = (SDField) schema.getDocument().getField("artist"); assertEquals(Stemming.SHORTEST, artist.getStemming(schema)); @@ -43,7 +43,7 @@ public class StemmingSettingTestCase extends AbstractSchemaTestCase { @Test public void requireThatStemmingIsDefaultBest() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/stemmingdefault.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/stemmingdefault.sd"); assertNull(schema.getConcreteField("my_str").getStemming()); assertEquals(Stemming.BEST, schema.getConcreteField("my_str").getStemming(schema)); } diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/StructTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/StructTestCase.java index b86225110df..0c305df7e53 100755 --- a/config-model/src/test/java/com/yahoo/searchdefinition/StructTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/StructTestCase.java @@ -25,7 +25,7 @@ public class StructTestCase extends AbstractSchemaTestCase { @Test public void testBadStruct() throws IOException { try { - SearchBuilder.buildFromFile("src/test/examples/badstruct.sd"); + SchemaBuilder.buildFromFile("src/test/examples/badstruct.sd"); fail("Should throw exception."); } catch (ParseException expected) { // success @@ -46,7 +46,7 @@ public class StructTestCase extends AbstractSchemaTestCase { */ @Test(expected = IllegalArgumentException.class) public void testStructOutsideDocumentIllegal() throws IOException, ParseException { - SearchBuilder.buildFromFile("src/test/examples/structoutsideofdocument.sd"); + SchemaBuilder.buildFromFile("src/test/examples/structoutsideofdocument.sd"); } } diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/SummaryTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/SummaryTestCase.java index dee63f04ad5..ba1795db406 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/SummaryTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/SummaryTestCase.java @@ -39,7 +39,7 @@ public class SummaryTestCase { " }", "}"); DeployLoggerStub logger = new DeployLoggerStub(); - SearchBuilder.createFromString(sd, logger); + SchemaBuilder.createFromString(sd, logger); assertTrue(logger.entries.isEmpty()); } @@ -61,7 +61,7 @@ public class SummaryTestCase { " }", "}"); DeployLoggerStub logger = new DeployLoggerStub(); - SearchBuilder.createFromString(sd, logger); + SchemaBuilder.createFromString(sd, logger); assertEquals(1, logger.entries.size()); assertEquals(Level.WARNING, logger.entries.get(0).level); assertEquals("summary field 'foo2' in document summary 'foobar' references source field 'ondisk', " + @@ -89,7 +89,7 @@ public class SummaryTestCase { " }", "}"); DeployLoggerStub logger = new DeployLoggerStub(); - SearchBuilder.createFromString(sd, logger); + SchemaBuilder.createFromString(sd, logger); assertTrue(logger.entries.isEmpty()); } @@ -120,7 +120,7 @@ public class SummaryTestCase { " }", "}"); DeployLoggerStub logger = new DeployLoggerStub(); - SearchBuilder.createFromString(sd, logger); + SchemaBuilder.createFromString(sd, logger); assertTrue(logger.entries.isEmpty()); } @@ -156,7 +156,7 @@ public class SummaryTestCase { " }", "}"); var logger = new DeployLoggerStub(); - var search = SearchBuilder.createFromString(sd, logger).getSearch(); + var search = SchemaBuilder.createFromString(sd, logger).getSchema(); assertEquals(List.of(), logger.entries); var titleField = "title"; @@ -208,7 +208,7 @@ public class SummaryTestCase { "}"); var logger = new DeployLoggerStub(); try { - SearchBuilder.createFromString(sd, logger); + SchemaBuilder.createFromString(sd, logger); fail("Expected exception"); } catch (IllegalArgumentException e) { assertEquals("For schema 'music', summary class 'title2', summary field 'title': Can not use " + @@ -228,7 +228,7 @@ public class SummaryTestCase { " }" + "}"); DeployLoggerStub logger = new DeployLoggerStub(); - SearchBuilder.createFromStrings(logger, schema); + SchemaBuilder.createFromStrings(logger, schema); assertEquals("document summary 'test_summary' inherits nonesuch but this is not present in schema 'test'", logger.entries.get(0).message); // fail("Expected failure"); @@ -264,7 +264,7 @@ public class SummaryTestCase { " }" + "}"); DeployLoggerStub logger = new DeployLoggerStub(); - SearchBuilder.createFromStrings(logger, parent, child); + SchemaBuilder.createFromStrings(logger, parent, child); logger.entries.forEach(e -> System.out.println(e)); //assertTrue(logger.entries.isEmpty()); } diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/UrlFieldValidationTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/UrlFieldValidationTestCase.java index 8873fc36303..9fdeb9ece1d 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/UrlFieldValidationTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/UrlFieldValidationTestCase.java @@ -15,7 +15,7 @@ public class UrlFieldValidationTestCase { @Test public void requireThatInheritedRiseFieldsStillCanBeInConflictButDontThrowException() throws ParseException { - SearchBuilder builder = new SearchBuilder(); + SchemaBuilder builder = new SchemaBuilder(); builder.importString("search test {" + " document test { " + " field a type uri { indexing: attribute | summary }" + diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/AbstractExportingTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/AbstractExportingTestCase.java index 9ba9f3b37f7..da14e4a8929 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/AbstractExportingTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/AbstractExportingTestCase.java @@ -8,7 +8,7 @@ import com.yahoo.config.model.deploy.TestProperties; import com.yahoo.document.DocumenttypesConfig; import com.yahoo.document.config.DocumentmanagerConfig; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.AbstractSchemaTestCase; import com.yahoo.searchdefinition.parser.ParseException; import ai.vespa.rankingexpression.importer.configmodelview.ImportedMlModels; @@ -36,16 +36,16 @@ public abstract class AbstractExportingTestCase extends AbstractSchemaTestCase { toDir.mkdirs(); deleteContent(toDir); - SearchBuilder builder = SearchBuilder.createFromDirectory(searchDefRoot + dirName + "/", new MockFileRegistry(), logger, properties); + SchemaBuilder builder = SchemaBuilder.createFromDirectory(searchDefRoot + dirName + "/", new MockFileRegistry(), logger, properties); return derive(dirName, searchDefinitionName, properties, builder, logger); } private DerivedConfiguration derive(String dirName, String searchDefinitionName, TestProperties properties, - SearchBuilder builder, + SchemaBuilder builder, DeployLogger logger) throws IOException { - DerivedConfiguration config = new DerivedConfiguration(builder.getSearch(searchDefinitionName), + DerivedConfiguration config = new DerivedConfiguration(builder.getSchema(searchDefinitionName), logger, properties, builder.getRankProfileRegistry(), @@ -55,14 +55,14 @@ public abstract class AbstractExportingTestCase extends AbstractSchemaTestCase { return export(dirName, builder, config); } - DerivedConfiguration derive(String dirName, SearchBuilder builder, Schema schema) throws IOException { + DerivedConfiguration derive(String dirName, SchemaBuilder builder, Schema schema) throws IOException { DerivedConfiguration config = new DerivedConfiguration(schema, builder.getRankProfileRegistry(), builder.getQueryProfileRegistry()); return export(dirName, builder, config); } - private DerivedConfiguration export(String name, SearchBuilder builder, DerivedConfiguration config) throws IOException { + private DerivedConfiguration export(String name, SchemaBuilder builder, DerivedConfiguration config) throws IOException { String path = exportConfig(name, config); DerivedConfiguration.exportDocuments(new DocumentManager().produce(builder.getModel(), new DocumentmanagerConfig.Builder()), path); DerivedConfiguration.exportDocuments(new DocumentTypes().produce(builder.getModel(), new DocumenttypesConfig.Builder()), path); @@ -111,14 +111,14 @@ public abstract class AbstractExportingTestCase extends AbstractSchemaTestCase { * Asserts config is correctly derived given a builder. * This will fail if the builder contains multiple search definitions. */ - protected DerivedConfiguration assertCorrectDeriving(SearchBuilder builder, String dirName, DeployLogger logger) throws IOException { + protected DerivedConfiguration assertCorrectDeriving(SchemaBuilder builder, String dirName, DeployLogger logger) throws IOException { builder.build(); DerivedConfiguration derived = derive(dirName, null, new TestProperties(), builder, logger); assertCorrectConfigFiles(dirName); return derived; } - protected DerivedConfiguration assertCorrectDeriving(SearchBuilder builder, Schema schema, String name) throws IOException { + protected DerivedConfiguration assertCorrectDeriving(SchemaBuilder builder, Schema schema, String name) throws IOException { DerivedConfiguration derived = derive(name, builder, schema); assertCorrectConfigFiles(name); return derived; diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/AttributeListTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/AttributeListTestCase.java index f8316c831f1..58a4350b73b 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/AttributeListTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/AttributeListTestCase.java @@ -2,7 +2,7 @@ package com.yahoo.searchdefinition.derived; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.AbstractSchemaTestCase; import com.yahoo.searchdefinition.document.Attribute; import com.yahoo.searchdefinition.parser.ParseException; @@ -25,7 +25,7 @@ public class AttributeListTestCase extends AbstractSchemaTestCase { @Test public void testDeriving() throws IOException, ParseException { // Test attribute importing - Schema schema = SearchBuilder.buildFromFile("src/test/examples/simple.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/simple.sd"); // Test attribute deriving AttributeFields attributeFields = new AttributeFields(schema); @@ -71,7 +71,7 @@ public class AttributeListTestCase extends AbstractSchemaTestCase { @Test public void fields_in_array_of_struct_are_derived_into_array_attributes() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/derived/array_of_struct_attribute/test.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/derived/array_of_struct_attribute/test.sd"); Iterator<Attribute> attributes = new AttributeFields(schema).attributeIterator(); assertAttribute("elem_array.name", Attribute.Type.STRING, Attribute.CollectionType.ARRAY, true, attributes.next()); @@ -81,7 +81,7 @@ public class AttributeListTestCase extends AbstractSchemaTestCase { @Test public void fields_in_map_of_struct_are_derived_into_array_attributes() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/derived/map_of_struct_attribute/test.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/derived/map_of_struct_attribute/test.sd"); Iterator<Attribute> attributes = new AttributeFields(schema).attributeIterator(); assertAttribute("str_elem_map.key", Attribute.Type.STRING, Attribute.CollectionType.ARRAY, true, attributes.next()); @@ -101,14 +101,14 @@ public class AttributeListTestCase extends AbstractSchemaTestCase { @Test public void only_zcurve_attribute_is_derived_from_array_of_position_field() throws ParseException { - Schema schema = SearchBuilder.createFromString( + Schema schema = SchemaBuilder.createFromString( joinLines("search test {", " document test {", " field pos_array type array<position> {", " indexing: attribute", " }", " }", - "}")).getSearch(); + "}")).getSchema(); Iterator<Attribute> attributes = new AttributeFields(schema).attributeIterator(); assertAttribute("pos_array_zcurve", Attribute.Type.LONG, Attribute.CollectionType.ARRAY, true, attributes.next()); @@ -117,7 +117,7 @@ public class AttributeListTestCase extends AbstractSchemaTestCase { @Test public void fields_in_map_of_primitive_are_derived_into_array_attributes() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/derived/map_attribute/test.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/derived/map_attribute/test.sd"); Iterator<Attribute> attributes = new AttributeFields(schema).attributeIterator(); assertAttribute("str_map.key", Attribute.Type.STRING, Attribute.CollectionType.ARRAY, true, attributes.next()); diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/CasingTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/CasingTestCase.java index 080752d260f..06d72bb6972 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/CasingTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/CasingTestCase.java @@ -2,7 +2,7 @@ package com.yahoo.searchdefinition.derived; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.AbstractSchemaTestCase; import com.yahoo.searchdefinition.parser.ParseException; import org.junit.Test; @@ -20,7 +20,7 @@ public class CasingTestCase extends AbstractSchemaTestCase { @Test public void testCasing() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/casing.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/casing.sd"); assertEquals(schema.getIndex("color").getName(), "color"); assertEquals(schema.getIndex("Foo").getName(), "Foo"); assertEquals(schema.getIndex("Price").getName(), "Price"); diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/EmptyRankProfileTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/EmptyRankProfileTestCase.java index 2633f7881bd..604082fb52e 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/EmptyRankProfileTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/EmptyRankProfileTestCase.java @@ -5,7 +5,7 @@ import com.yahoo.document.DataType; import com.yahoo.search.query.profile.QueryProfileRegistry; import com.yahoo.searchdefinition.RankProfileRegistry; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.AbstractSchemaTestCase; import com.yahoo.searchdefinition.document.SDDocumentType; import com.yahoo.searchdefinition.document.SDField; @@ -30,7 +30,7 @@ public class EmptyRankProfileTestCase extends AbstractSchemaTestCase { doc.addField(field); doc.addField(new SDField("c", DataType.STRING)); - schema = SearchBuilder.buildFromRawSearch(schema, rankProfileRegistry, new QueryProfileRegistry()); + schema = SchemaBuilder.buildFromRawSchema(schema, rankProfileRegistry, new QueryProfileRegistry()); new DerivedConfiguration(schema, rankProfileRegistry); } diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/ExportingTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/ExportingTestCase.java index 867b88019d5..c6a10c5530b 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/ExportingTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/ExportingTestCase.java @@ -2,7 +2,7 @@ package com.yahoo.searchdefinition.derived; import com.yahoo.config.model.deploy.TestProperties; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.parser.ParseException; import org.junit.Test; @@ -146,11 +146,11 @@ public class ExportingTestCase extends AbstractExportingTestCase { @Test public void testTensor2() throws IOException, ParseException { String dir = "src/test/derived/tensor2/"; - SearchBuilder builder = new SearchBuilder(); + SchemaBuilder builder = new SchemaBuilder(); builder.importFile(dir + "first.sd"); builder.importFile(dir + "second.sd"); builder.build(); - derive("tensor2", builder, builder.getSearch("second")); + derive("tensor2", builder, builder.getSchema("second")); assertCorrectConfigFiles("tensor2"); } diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/InheritanceTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/InheritanceTestCase.java index 59950cee638..97cfc48580d 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/InheritanceTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/InheritanceTestCase.java @@ -5,7 +5,7 @@ import com.yahoo.document.DataType; import com.yahoo.document.config.DocumentmanagerConfig; import com.yahoo.searchdefinition.Index; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.document.SDDocumentType; import com.yahoo.searchdefinition.document.SDField; import com.yahoo.searchdefinition.parser.ParseException; @@ -37,11 +37,11 @@ public class InheritanceTestCase extends AbstractExportingTestCase { @Test public void requireThatIndexedStructFieldCanBeInherited() throws IOException, ParseException { String dir = "src/test/derived/inheritstruct/"; - SearchBuilder builder = new SearchBuilder(); + SchemaBuilder builder = new SchemaBuilder(); builder.importFile(dir + "parent.sd"); builder.importFile(dir + "child.sd"); builder.build(); - derive("inheritstruct", builder, builder.getSearch("child")); + derive("inheritstruct", builder, builder.getSchema("child")); assertCorrectConfigFiles("inheritstruct"); } @@ -60,7 +60,7 @@ public class InheritanceTestCase extends AbstractExportingTestCase { List<String> files = Arrays.asList("grandparent.sd", "mother.sd", "father.sd", "child.sd"); File outDir = tmpDir.newFolder("out"); for (int startIdx = 0; startIdx < files.size(); ++startIdx) { - SearchBuilder builder = new SearchBuilder(); + SchemaBuilder builder = new SchemaBuilder(); for (int fileIdx = startIdx; fileIdx < startIdx + files.size(); ++fileIdx) { String fileName = files.get(fileIdx % files.size()); builder.importFile(dir + fileName); @@ -107,36 +107,36 @@ public class InheritanceTestCase extends AbstractExportingTestCase { @Test public void requireThatStructTypesAreInheritedFromParent() throws IOException, ParseException { String dir = "src/test/derived/inheritfromparent/"; - SearchBuilder builder = new SearchBuilder(); + SchemaBuilder builder = new SchemaBuilder(); builder.importFile(dir + "parent.sd"); builder.importFile(dir + "child.sd"); builder.build(); - derive("inheritfromparent", builder, builder.getSearch("child")); + derive("inheritfromparent", builder, builder.getSchema("child")); assertCorrectConfigFiles("inheritfromparent"); } @Test public void requireThatStructTypesAreInheritedFromGrandParent() throws IOException, ParseException { String dir = "src/test/derived/inheritfromgrandparent/"; - SearchBuilder builder = new SearchBuilder(); + SchemaBuilder builder = new SchemaBuilder(); builder.importFile(dir + "grandparent.sd"); builder.importFile(dir + "parent.sd"); builder.importFile(dir + "child.sd"); builder.build(); - derive("inheritfromgrandparent", builder, builder.getSearch("child")); + derive("inheritfromgrandparent", builder, builder.getSchema("child")); assertCorrectConfigFiles("inheritfromgrandparent"); } @Test public void testInheritance() throws IOException, ParseException { String dir = "src/test/derived/inheritance/"; - SearchBuilder builder = new SearchBuilder(); + SchemaBuilder builder = new SchemaBuilder(); builder.importFile(dir + "grandparent.sd"); builder.importFile(dir + "father.sd"); builder.importFile(dir + "mother.sd"); builder.importFile(dir + "child.sd"); builder.build(); - derive("inheritance", builder, builder.getSearch("child")); + derive("inheritance", builder, builder.getSchema("child")); assertCorrectConfigFiles("inheritance"); } diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/LiteralBoostTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/LiteralBoostTestCase.java index 507c5370237..f8f1bf9e4f1 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/LiteralBoostTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/LiteralBoostTestCase.java @@ -7,7 +7,7 @@ import com.yahoo.search.query.profile.QueryProfileRegistry; import com.yahoo.searchdefinition.RankProfile; import com.yahoo.searchdefinition.RankProfileRegistry; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.document.SDDocumentType; import com.yahoo.searchdefinition.document.SDField; import com.yahoo.searchdefinition.processing.Processing; @@ -73,7 +73,7 @@ public class LiteralBoostTestCase extends AbstractExportingTestCase { rankProfileRegistry.add(other); other.addRankSetting(new RankProfile.RankSetting("a", RankProfile.RankSetting.Type.LITERALBOOST, 333)); - schema = SearchBuilder.buildFromRawSearch(schema, rankProfileRegistry, new QueryProfileRegistry()); + schema = SchemaBuilder.buildFromRawSchema(schema, rankProfileRegistry, new QueryProfileRegistry()); DerivedConfiguration derived = new DerivedConfiguration(schema, rankProfileRegistry); // Check il script addition @@ -100,7 +100,7 @@ public class LiteralBoostTestCase extends AbstractExportingTestCase { field2.parseIndexingScript("{ summary | index }"); field2.setLiteralBoost(20); - schema = SearchBuilder.buildFromRawSearch(schema, rankProfileRegistry, new QueryProfileRegistry()); + schema = SchemaBuilder.buildFromRawSchema(schema, rankProfileRegistry, new QueryProfileRegistry()); new DerivedConfiguration(schema, rankProfileRegistry); assertIndexing(Arrays.asList("clear_state | guard { input title | tokenize normalize stem:\"BEST\" | summary title | index title; }", "clear_state | guard { input body | tokenize normalize stem:\"BEST\" | summary body | index body; }", diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/MailTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/MailTestCase.java index 198013b73c0..9ad6dfbb972 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/MailTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/MailTestCase.java @@ -1,7 +1,7 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.searchdefinition.derived; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.parser.ParseException; import org.junit.Test; import java.io.IOException; @@ -16,7 +16,7 @@ public class MailTestCase extends AbstractExportingTestCase { @Test public void testMail() throws IOException, ParseException { String dir = "src/test/derived/mail/"; - SearchBuilder sb = new SearchBuilder(); + SchemaBuilder sb = new SchemaBuilder(); sb.importFile(dir + "mail.sd"); assertCorrectDeriving(sb, dir, new TestableDeployLogger()); } diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/SchemaInheritanceTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/SchemaInheritanceTestCase.java index 254ed26df36..c7297c41c62 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/SchemaInheritanceTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/SchemaInheritanceTestCase.java @@ -4,8 +4,7 @@ package com.yahoo.searchdefinition.derived; import com.yahoo.config.model.application.provider.MockFileRegistry; import com.yahoo.config.model.deploy.TestProperties; import com.yahoo.io.IOUtils; -import com.yahoo.searchdefinition.RankProfileRegistry; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.parser.ParseException; import org.junit.Test; @@ -20,11 +19,11 @@ public class SchemaInheritanceTestCase extends AbstractExportingTestCase { @Test public void testIt() throws IOException, ParseException { try { - SearchBuilder builder = SearchBuilder.createFromDirectory("src/test/derived/schemainheritance/", + SchemaBuilder builder = SchemaBuilder.createFromDirectory("src/test/derived/schemainheritance/", new MockFileRegistry(), new TestableDeployLogger(), new TestProperties()); - derive("schemainheritance", builder, builder.getSearch("child")); + derive("schemainheritance", builder, builder.getSchema("child")); assertCorrectConfigFiles("schemainheritance"); } finally { diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/SimpleInheritTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/SimpleInheritTestCase.java index 106f5a54cfe..c0f2b6887d2 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/SimpleInheritTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/SimpleInheritTestCase.java @@ -2,7 +2,7 @@ package com.yahoo.searchdefinition.derived; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.parser.ParseException; import org.junit.Test; @@ -19,12 +19,12 @@ public class SimpleInheritTestCase extends AbstractExportingTestCase { String name = "emptychild"; final String expectedResultsDirName = "src/test/derived/" + name + "/"; - SearchBuilder builder = new SearchBuilder(); + SchemaBuilder builder = new SchemaBuilder(); builder.importFile(expectedResultsDirName + "parent.sd"); builder.importFile(expectedResultsDirName + "child.sd"); builder.build(); - Schema schema = builder.getSearch("child"); + Schema schema = builder.getSchema("child"); String toDirName = "temp/" + name; File toDir = new File(toDirName); diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/SummaryMapTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/SummaryMapTestCase.java index 92b7184959c..4994cffb92a 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/SummaryMapTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/SummaryMapTestCase.java @@ -29,7 +29,7 @@ import static org.junit.Assert.assertTrue; public class SummaryMapTestCase extends AbstractSchemaTestCase { @Test public void testDeriving() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/simple.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/simple.sd"); SummaryMap summaryMap=new SummaryMap(schema); Iterator transforms=summaryMap.resultTransformIterator(); @@ -147,7 +147,7 @@ public class SummaryMapTestCase extends AbstractSchemaTestCase { @Test public void testFailOnSummaryFieldSourceCollision() { try { - SearchBuilder.buildFromFile("src/test/examples/summaryfieldcollision.sd"); + SchemaBuilder.buildFromFile("src/test/examples/summaryfieldcollision.sd"); } catch (Exception e) { assertTrue(e.getMessage().matches(".*equally named field.*")); } @@ -189,14 +189,14 @@ public class SummaryMapTestCase extends AbstractSchemaTestCase { } private Schema buildSearch(String field) throws ParseException { - var builder = new SearchBuilder(new RankProfileRegistry()); + var builder = new SchemaBuilder(new RankProfileRegistry()); builder.importString(joinLines("search test {", " document test {", field, " }", "}")); builder.build(); - return builder.getSearch(); + return builder.getSchema(); } } diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/SummaryTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/SummaryTestCase.java index ea801b54b5c..c996fb0c1b9 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/SummaryTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/SummaryTestCase.java @@ -3,7 +3,7 @@ package com.yahoo.searchdefinition.derived; import com.yahoo.config.model.application.provider.BaseDeployLogger; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.AbstractSchemaTestCase; import com.yahoo.searchdefinition.parser.ParseException; import com.yahoo.vespa.config.search.SummaryConfig; @@ -35,7 +35,7 @@ public class SummaryTestCase extends AbstractSchemaTestCase { " }", " }", "}"); - Schema schema = SearchBuilder.createFromString(sd).getSearch(); + Schema schema = SchemaBuilder.createFromString(sd).getSchema(); SummaryClass summary = new SummaryClass(schema, schema.getSummary("default"), new BaseDeployLogger()); assertEquals(SummaryClassField.Type.RAW, summary.getField("raw_field").getType()); } @@ -50,14 +50,14 @@ public class SummaryTestCase extends AbstractSchemaTestCase { " }", " }", "}"); - Schema schema = SearchBuilder.createFromString(sd).getSearch(); + Schema schema = SchemaBuilder.createFromString(sd).getSchema(); SummaryClass summary = new SummaryClass(schema, schema.getSummary("default"), new BaseDeployLogger()); assertEquals(SummaryClassField.Type.DATA, summary.getField("raw_field").getType()); } @Test public void testDeriving() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/simple.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/simple.sd"); SummaryClass summary = new SummaryClass(schema, schema.getSummary("default"), new BaseDeployLogger()); assertEquals("default", summary.getName()); @@ -134,7 +134,7 @@ public class SummaryTestCase extends AbstractSchemaTestCase { } private static Schema buildCampaignAdModel() throws ParseException { - SearchBuilder builder = new SearchBuilder(); + SchemaBuilder builder = new SchemaBuilder(); builder.importString("search campaign { document campaign {} }"); builder.importString(joinLines("search ad {", " document ad {", @@ -150,7 +150,7 @@ public class SummaryTestCase extends AbstractSchemaTestCase { " }", "}")); builder.build(); - return builder.getSearch("ad"); + return builder.getSchema("ad"); } @Test @@ -168,7 +168,7 @@ public class SummaryTestCase extends AbstractSchemaTestCase { " summary foo type string {}", " }", "}"); - var search = SearchBuilder.createFromString(sd).getSearch(); + var search = SchemaBuilder.createFromString(sd).getSchema(); assertOmitSummaryFeatures(true, search, "bar"); assertOmitSummaryFeatures(false, search, "baz"); } diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/TwoStreamingStructsTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/TwoStreamingStructsTestCase.java index 8249245cebe..c3a78bab441 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/TwoStreamingStructsTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/TwoStreamingStructsTestCase.java @@ -1,7 +1,7 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.searchdefinition.derived; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.parser.ParseException; import org.junit.Test; @@ -17,16 +17,16 @@ public class TwoStreamingStructsTestCase extends AbstractExportingTestCase { public void testTwoStreamingStructsExporting() throws ParseException, IOException { String root = "src/test/derived/twostreamingstructs"; - SearchBuilder builder = new SearchBuilder(); + SchemaBuilder builder = new SchemaBuilder(); builder.importFile(root + "/streamingstruct.sd"); builder.importFile(root + "/whatever.sd"); builder.build(); - assertCorrectDeriving(builder, builder.getSearch("streamingstruct"), root); + assertCorrectDeriving(builder, builder.getSchema("streamingstruct"), root); - builder = new SearchBuilder(); + builder = new SchemaBuilder(); builder.importFile(root + "/streamingstruct.sd"); builder.importFile(root + "/whatever.sd"); builder.build(); - assertCorrectDeriving(builder, builder.getSearch("streamingstruct"), root); + assertCorrectDeriving(builder, builder.getSchema("streamingstruct"), root); } } diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/document/ComplexAttributeFieldUtilsTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/document/ComplexAttributeFieldUtilsTestCase.java index 449e8054728..481a4db11ec 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/document/ComplexAttributeFieldUtilsTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/document/ComplexAttributeFieldUtilsTestCase.java @@ -2,7 +2,7 @@ package com.yahoo.searchdefinition.document; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.parser.ParseException; import org.junit.Test; @@ -17,7 +17,7 @@ public class ComplexAttributeFieldUtilsTestCase { private final ImmutableSDField field; FixtureBase(String fieldName, String sdContent) throws ParseException { - Schema schema = SearchBuilder.createFromString(sdContent).getSearch(); + Schema schema = SchemaBuilder.createFromString(sdContent).getSchema(); field = schema.getConcreteField(fieldName); } diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/AssertSearchBuilder.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/AssertSearchBuilder.java index d32dd961a85..6a736a5331e 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/AssertSearchBuilder.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/AssertSearchBuilder.java @@ -1,7 +1,7 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.searchdefinition.processing; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.parser.ParseException; import java.io.IOException; @@ -14,13 +14,13 @@ import static org.junit.Assert.*; public abstract class AssertSearchBuilder { public static void assertBuilds(String searchDefinitionFileName) throws IOException, ParseException { - assertNotNull(SearchBuilder.buildFromFile(searchDefinitionFileName)); + assertNotNull(SchemaBuilder.buildFromFile(searchDefinitionFileName)); } public static void assertBuildFails(String searchDefinitionFileName, String expectedException) throws IOException, ParseException { try { - SearchBuilder.buildFromFile(searchDefinitionFileName); + SchemaBuilder.buildFromFile(searchDefinitionFileName); fail(searchDefinitionFileName); } catch (IllegalArgumentException e) { assertEquals(expectedException, e.getMessage()); diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/AttributesExactMatchTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/AttributesExactMatchTestCase.java index 57e01cb9dfc..f1aa64c1a60 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/AttributesExactMatchTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/AttributesExactMatchTestCase.java @@ -2,7 +2,7 @@ package com.yahoo.searchdefinition.processing; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.AbstractSchemaTestCase; import com.yahoo.searchdefinition.document.Matching; import com.yahoo.searchdefinition.parser.ParseException; @@ -20,7 +20,7 @@ import static org.junit.Assert.assertFalse; public class AttributesExactMatchTestCase extends AbstractSchemaTestCase { @Test public void testAttributesExactMatch() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/attributesexactmatch.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/attributesexactmatch.sd"); assertEquals(schema.getConcreteField("color").getMatching().getType(), Matching.Type.EXACT); assertEquals(schema.getConcreteField("artist").getMatching().getType(), Matching.Type.WORD); assertEquals(schema.getConcreteField("drummer").getMatching().getType(), Matching.Type.WORD); diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/BoldingTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/BoldingTestCase.java index d9d8e47338b..f74e46d92dc 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/BoldingTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/BoldingTestCase.java @@ -1,7 +1,7 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.searchdefinition.processing; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.AbstractSchemaTestCase; import com.yahoo.searchdefinition.parser.ParseException; import org.junit.Test; @@ -31,7 +31,7 @@ public class BoldingTestCase extends AbstractSchemaTestCase { @Test public void testBoldOnNonString() throws ParseException { try { - SearchBuilder.createFromString(boldonnonstring); + SchemaBuilder.createFromString(boldonnonstring); fail("Expected exception"); } catch (IllegalArgumentException e) { assertEquals("'bolding: on' for non-text field 'year4' (datatype int (code: 0)) is not allowed", @@ -52,7 +52,7 @@ public class BoldingTestCase extends AbstractSchemaTestCase { @Test public void testBoldOnArray() throws ParseException { try { - SearchBuilder.createFromString(boldonarray); + SchemaBuilder.createFromString(boldonarray); fail("Expected exception"); } catch (IllegalArgumentException e) { assertEquals("'bolding: on' for non-text field 'myarray' (datatype Array<string> (code: -1486737430)) is not allowed", diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/BoolAttributeValidatorTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/BoolAttributeValidatorTestCase.java index fbfb46be558..342ff4ba2d4 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/BoolAttributeValidatorTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/BoolAttributeValidatorTestCase.java @@ -4,7 +4,7 @@ package com.yahoo.searchdefinition.processing; import com.yahoo.searchdefinition.parser.ParseException; import org.junit.Test; -import static com.yahoo.searchdefinition.SearchBuilder.createFromString; +import static com.yahoo.searchdefinition.SchemaBuilder.createFromString; import static com.yahoo.config.model.test.TestUtil.joinLines; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/DictionaryTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/DictionaryTestCase.java index 806b9b3358d..6f8ab24de8e 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/DictionaryTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/DictionaryTestCase.java @@ -4,7 +4,7 @@ package com.yahoo.searchdefinition.processing; import com.yahoo.config.model.test.TestUtil; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.derived.AttributeFields; import com.yahoo.searchdefinition.document.Case; import com.yahoo.searchdefinition.document.Dictionary; @@ -30,8 +30,8 @@ public class DictionaryTestCase { return builder.build(); } private Schema createSearch(String def) throws ParseException { - SearchBuilder sb = SearchBuilder.createFromString(def); - return sb.getSearch(); + SchemaBuilder sb = SchemaBuilder.createFromString(def); + return sb.getSchema(); } @Test public void testDefaultDictionarySettings() throws ParseException { @@ -196,7 +196,7 @@ public class DictionaryTestCase { " }", "}"); try { - SearchBuilder sb = SearchBuilder.createFromString(def); + SchemaBuilder sb = SchemaBuilder.createFromString(def); fail("Controlling dictionary for non-numeric fields are not yet supported."); } catch (IllegalArgumentException e) { assertEquals("For schema 'test', field 'n1': You can only specify 'dictionary:' for numeric or string fields", e.getMessage()); @@ -214,7 +214,7 @@ public class DictionaryTestCase { " }", "}"); try { - SearchBuilder sb = SearchBuilder.createFromString(def); + SchemaBuilder sb = SchemaBuilder.createFromString(def); fail("Controlling dictionary for non-fast-search fields are not allowed."); } catch (IllegalArgumentException e) { assertEquals("For schema 'test', field 'n1': You must specify 'attribute:fast-search' to allow dictionary control", e.getMessage()); diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/DisallowComplexMapAndWsetKeyTypesTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/DisallowComplexMapAndWsetKeyTypesTestCase.java index dc6f9b0d6db..03125c48d1d 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/DisallowComplexMapAndWsetKeyTypesTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/DisallowComplexMapAndWsetKeyTypesTestCase.java @@ -2,7 +2,7 @@ package com.yahoo.searchdefinition.processing; import com.yahoo.searchdefinition.RankProfileRegistry; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.parser.ParseException; import org.junit.Test; @@ -43,7 +43,7 @@ public class DisallowComplexMapAndWsetKeyTypesTestCase { private void testFieldType(String fieldType) throws ParseException { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder builder = new SearchBuilder(rankProfileRegistry); + SchemaBuilder builder = new SchemaBuilder(rankProfileRegistry); builder.importString( "search test {\n" + " document test { \n" + diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/FastAccessValidatorTest.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/FastAccessValidatorTest.java index 0a9807e0746..00f67c80084 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/FastAccessValidatorTest.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/FastAccessValidatorTest.java @@ -3,7 +3,7 @@ package com.yahoo.searchdefinition.processing; import com.yahoo.config.model.test.TestUtil; import com.yahoo.searchdefinition.RankProfileRegistry; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.parser.ParseException; import org.junit.Rule; import org.junit.Test; @@ -19,7 +19,7 @@ public class FastAccessValidatorTest { @Test public void throws_exception_on_incompatible_use_of_fastaccess() throws ParseException { - SearchBuilder builder = new SearchBuilder(new RankProfileRegistry()); + SchemaBuilder builder = new SchemaBuilder(new RankProfileRegistry()); builder.importString( TestUtil.joinLines( "schema parent {", diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/ImplicitSchemaFieldsTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/ImplicitSchemaFieldsTestCase.java index dffc0d968df..43077fadfcd 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/ImplicitSchemaFieldsTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/ImplicitSchemaFieldsTestCase.java @@ -2,7 +2,7 @@ package com.yahoo.searchdefinition.processing; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.AbstractSchemaTestCase; import com.yahoo.searchdefinition.derived.DerivedConfiguration; import com.yahoo.searchdefinition.document.SDDocumentType; @@ -18,7 +18,7 @@ public class ImplicitSchemaFieldsTestCase extends AbstractSchemaTestCase { @Test public void testRequireThatExtraFieldsAreIncluded() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/nextgen/extrafield.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/nextgen/extrafield.sd"); assertNotNull(schema); SDDocumentType docType = schema.getDocument(); @@ -30,7 +30,7 @@ public class ImplicitSchemaFieldsTestCase extends AbstractSchemaTestCase { @Test public void testRequireThatSummaryFieldsAreIncluded() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/nextgen/summaryfield.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/nextgen/summaryfield.sd"); assertNotNull(schema); SDDocumentType docType = schema.getDocument(); @@ -43,7 +43,7 @@ public class ImplicitSchemaFieldsTestCase extends AbstractSchemaTestCase { @Test public void testRequireThatBoldedSummaryFieldsAreIncluded() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/nextgen/boldedsummaryfields.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/nextgen/boldedsummaryfields.sd"); assertNotNull(schema); SDDocumentType docType = schema.getDocument(); @@ -57,7 +57,7 @@ public class ImplicitSchemaFieldsTestCase extends AbstractSchemaTestCase { @Test public void testRequireThatUntransformedSummaryFieldsAreIgnored() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/nextgen/untransformedsummaryfields.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/nextgen/untransformedsummaryfields.sd"); assertNotNull(schema); SDDocumentType docType = schema.getDocument(); @@ -70,7 +70,7 @@ public class ImplicitSchemaFieldsTestCase extends AbstractSchemaTestCase { @Test public void testRequireThatDynamicSummaryFieldsAreIgnored() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/nextgen/dynamicsummaryfields.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/nextgen/dynamicsummaryfields.sd"); assertNotNull(schema); SDDocumentType docType = schema.getDocument(); @@ -82,11 +82,11 @@ public class ImplicitSchemaFieldsTestCase extends AbstractSchemaTestCase { @Test public void testRequireThatDerivedConfigurationWorks() throws IOException, ParseException { - SearchBuilder sb = new SearchBuilder(); + SchemaBuilder sb = new SchemaBuilder(); sb.importFile("src/test/examples/nextgen/simple.sd"); sb.build(); - assertNotNull(sb.getSearch()); - new DerivedConfiguration(sb.getSearch(), sb.getRankProfileRegistry()); + assertNotNull(sb.getSchema()); + new DerivedConfiguration(sb.getSchema(), sb.getRankProfileRegistry()); } } diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/ImplicitStructTypesTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/ImplicitStructTypesTestCase.java index b069f62ee92..bd645b68728 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/ImplicitStructTypesTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/ImplicitStructTypesTestCase.java @@ -3,7 +3,7 @@ package com.yahoo.searchdefinition.processing; import com.yahoo.document.*; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.AbstractSchemaTestCase; import com.yahoo.searchdefinition.document.SDDocumentType; import com.yahoo.searchdefinition.document.SDField; @@ -16,7 +16,7 @@ import static org.junit.Assert.*; public class ImplicitStructTypesTestCase extends AbstractSchemaTestCase { @Test public void testRequireThatImplicitStructsAreCreated() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/nextgen/toggleon.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/nextgen/toggleon.sd"); assertNotNull(schema); SDDocumentType docType = schema.getDocument(); @@ -25,7 +25,7 @@ public class ImplicitStructTypesTestCase extends AbstractSchemaTestCase { } @Test public void testRequireThatImplicitStructsAreUsed() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/nextgen/implicitstructtypes.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/nextgen/implicitstructtypes.sd"); assertNotNull(schema); SDDocumentType docType = schema.getDocument(); diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/ImplicitSummariesTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/ImplicitSummariesTestCase.java index 9f4008b5b39..9c1e5d0d8d7 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/ImplicitSummariesTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/ImplicitSummariesTestCase.java @@ -2,7 +2,7 @@ package com.yahoo.searchdefinition.processing; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.parser.ParseException; import com.yahoo.vespa.documentmodel.SummaryTransform; import org.junit.Test; @@ -29,7 +29,7 @@ public class ImplicitSummariesTestCase { LogHandler log = new LogHandler(); Logger.getLogger("").addHandler(log); - Schema schema = SearchBuilder.buildFromFile("src/test/examples/implicitsummaries_attribute.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/implicitsummaries_attribute.sd"); assertNotNull(schema); assertTrue(log.records.isEmpty()); } @@ -60,19 +60,19 @@ public class ImplicitSummariesTestCase { @Test public void attribute_combiner_transform_is_set_on_array_of_struct_with_only_struct_field_attributes() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/derived/array_of_struct_attribute/test.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/derived/array_of_struct_attribute/test.sd"); assertEquals(SummaryTransform.ATTRIBUTECOMBINER, schema.getSummaryField("elem_array").getTransform()); } @Test public void attribute_combiner_transform_is_set_on_map_of_struct_with_only_struct_field_attributes() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/derived/map_of_struct_attribute/test.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/derived/map_of_struct_attribute/test.sd"); assertEquals(SummaryTransform.ATTRIBUTECOMBINER, schema.getSummaryField("str_elem_map").getTransform()); } @Test public void attribute_combiner_transform_is_not_set_when_map_of_struct_has_some_struct_field_attributes() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/derived/map_of_struct_attribute/test.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/derived/map_of_struct_attribute/test.sd"); assertEquals(SummaryTransform.NONE, schema.getSummaryField("int_elem_map").getTransform()); } } diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/ImplicitSummaryFieldsTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/ImplicitSummaryFieldsTestCase.java index c9f941087ef..44b1d9387f1 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/ImplicitSummaryFieldsTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/ImplicitSummaryFieldsTestCase.java @@ -2,7 +2,7 @@ package com.yahoo.searchdefinition.processing; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.AbstractSchemaTestCase; import com.yahoo.searchdefinition.parser.ParseException; import com.yahoo.vespa.documentmodel.DocumentSummary; @@ -17,7 +17,7 @@ public class ImplicitSummaryFieldsTestCase extends AbstractSchemaTestCase { @Test public void testRequireThatImplicitFieldsAreCreated() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/implicitsummaryfields.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/implicitsummaryfields.sd"); assertNotNull(schema); DocumentSummary docsum = schema.getSummary("default"); diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/ImportedFieldsTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/ImportedFieldsTestCase.java index 37b7ab0955c..0ece6d57fe1 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/ImportedFieldsTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/ImportedFieldsTestCase.java @@ -2,7 +2,7 @@ package com.yahoo.searchdefinition.processing; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.derived.AttributeFields; import com.yahoo.searchdefinition.document.ImportedComplexField; import com.yahoo.searchdefinition.document.ImportedField; @@ -67,7 +67,7 @@ public class ImportedFieldsTestCase { } private static Schema buildAdSearch(String sdContent) throws ParseException { - SearchBuilder builder = new SearchBuilder(); + SchemaBuilder builder = new SchemaBuilder(); builder.importString(joinLines( "schema campaign {", " document campaign {", @@ -82,7 +82,7 @@ public class ImportedFieldsTestCase { "}")); builder.importString(sdContent); builder.build(); - return builder.getSearch("ad"); + return builder.getSchema("ad"); } private static void checkStructImport(AncestorStructSdBuilder parentBuilder) throws ParseException { @@ -311,20 +311,20 @@ public class ImportedFieldsTestCase { } private static Schema buildChildSearch(String parentSdContent, String sdContent) throws ParseException { - SearchBuilder builder = new SearchBuilder(); + SchemaBuilder builder = new SchemaBuilder(); builder.importString(parentSdContent); builder.importString(sdContent); builder.build(); - return builder.getSearch("child"); + return builder.getSchema("child"); } private static Schema buildChildSearch(String grandParentSdContent, String parentSdContent, String sdContent) throws ParseException { - SearchBuilder builder = new SearchBuilder(); + SchemaBuilder builder = new SchemaBuilder(); builder.importString(grandParentSdContent); builder.importString(parentSdContent); builder.importString(sdContent); builder.build(); - return builder.getSearch("child"); + return builder.getSchema("child"); } private static class AncestorPosSdBuilder extends NamedSdBuilder { @@ -468,10 +468,10 @@ public class ImportedFieldsTestCase { public void field_with_struct_field_attributes_can_be_imported_from_parents_that_use_inheritance() throws ParseException { var builder = buildParentsUsingInheritance(); - assertParentContainsEntriesAttributes(builder.getSearch("parent_a")); - assertParentContainsEntriesAttributes(builder.getSearch("parent_b")); + assertParentContainsEntriesAttributes(builder.getSchema("parent_a")); + assertParentContainsEntriesAttributes(builder.getSchema("parent_b")); - var child = builder.getSearch("child"); + var child = builder.getSchema("child"); checkImportedField("entries_from_a", "ref_parent_a", "parent_a", "entries", child, true); checkImportedField("entries_from_a.key", "ref_parent_a", "parent_a", "entries.key", child, true); checkImportedField("entries_from_a.value", "ref_parent_a", "parent_a", "entries.value", child, true); @@ -487,8 +487,8 @@ public class ImportedFieldsTestCase { assertTrue(attrs.containsAttribute("entries.value")); } - private SearchBuilder buildParentsUsingInheritance() throws ParseException { - var builder = new SearchBuilder(); + private SchemaBuilder buildParentsUsingInheritance() throws ParseException { + var builder = new SchemaBuilder(); builder.importString(joinLines("schema parent_a {", "document parent_a {", " struct Entry {", diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/IndexingScriptRewriterTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/IndexingScriptRewriterTestCase.java index 9cbecddfffa..3105e3c7efd 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/IndexingScriptRewriterTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/IndexingScriptRewriterTestCase.java @@ -6,7 +6,7 @@ import com.yahoo.document.DataType; import com.yahoo.searchdefinition.Index; import com.yahoo.searchdefinition.RankProfileRegistry; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.AbstractSchemaTestCase; import com.yahoo.searchdefinition.document.BooleanIndexDefinition; import com.yahoo.searchdefinition.document.SDDocumentType; @@ -120,7 +120,7 @@ public class IndexingScriptRewriterTestCase extends AbstractSchemaTestCase { "clear_state | guard { input smallattribute | attribute smallattribute; }", "clear_state | guard { input title | tokenize normalize stem:\"BEST\" | summary title | index title; }", "clear_state | guard { input title . \" \" . input category | tokenize | summary exact | index exact; }"), - SearchBuilder.buildFromFile("src/test/examples/simple.sd")); + SchemaBuilder.buildFromFile("src/test/examples/simple.sd")); } @Test @@ -129,7 +129,7 @@ public class IndexingScriptRewriterTestCase extends AbstractSchemaTestCase { Arrays.asList("clear_state | guard { input title_src | lowercase | normalize | " + " tokenize | index title; }", "clear_state | guard { input title_src | summary title_s; }"), - SearchBuilder.buildFromFile("src/test/examples/indexrewrite.sd")); + SchemaBuilder.buildFromFile("src/test/examples/indexrewrite.sd")); } @Test diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/IndexingValidationTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/IndexingValidationTestCase.java index 9f8e810f1f8..5b5c5cedc0d 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/IndexingValidationTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/IndexingValidationTestCase.java @@ -1,7 +1,7 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.searchdefinition.processing; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.derived.AbstractExportingTestCase; import com.yahoo.searchdefinition.parser.ParseException; import org.junit.Test; @@ -64,7 +64,7 @@ public class IndexingValidationTestCase extends AbstractExportingTestCase { assertIndexing( Arrays.asList("clear_state | guard { input my_index | tokenize normalize stem:\"BEST\" | index my_index | summary my_index }", "clear_state | guard { input my_input | tokenize normalize stem:\"BEST\" | index my_extra | summary my_extra }"), - SearchBuilder.buildFromFile("src/test/examples/indexing_extra.sd")); + SchemaBuilder.buildFromFile("src/test/examples/indexing_extra.sd")); } @Test diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/IntegerIndex2AttributeTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/IntegerIndex2AttributeTestCase.java index cd5dd451026..4b13590c777 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/IntegerIndex2AttributeTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/IntegerIndex2AttributeTestCase.java @@ -4,7 +4,7 @@ package com.yahoo.searchdefinition.processing; import com.yahoo.config.model.application.provider.BaseDeployLogger; import com.yahoo.searchdefinition.RankProfileRegistry; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.AbstractSchemaTestCase; import com.yahoo.searchdefinition.document.SDField; import com.yahoo.searchdefinition.parser.ParseException; @@ -24,7 +24,7 @@ public class IntegerIndex2AttributeTestCase extends AbstractSchemaTestCase { @Test public void testIntegerIndex2Attribute() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/integerindex2attribute.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/integerindex2attribute.sd"); new IntegerIndex2Attribute(schema, new BaseDeployLogger(), new RankProfileRegistry(), new QueryProfiles()).process(true, false); SDField f; diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/MatchedElementsOnlyResolverTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/MatchedElementsOnlyResolverTestCase.java index fc44d61541e..568e2d65d2c 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/MatchedElementsOnlyResolverTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/MatchedElementsOnlyResolverTestCase.java @@ -3,7 +3,7 @@ package com.yahoo.searchdefinition.processing; import com.yahoo.searchdefinition.RankProfileRegistry; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.parser.ParseException; import com.yahoo.vespa.documentmodel.SummaryField; import com.yahoo.vespa.documentmodel.SummaryTransform; @@ -174,7 +174,7 @@ public class MatchedElementsOnlyResolverTestCase { } private Schema buildSearch(String field, String summary) throws ParseException { - var builder = new SearchBuilder(new RankProfileRegistry()); + var builder = new SchemaBuilder(new RankProfileRegistry()); builder.importString(joinLines("search test {", " document test {", " struct elem {", @@ -186,6 +186,6 @@ public class MatchedElementsOnlyResolverTestCase { summary, "}")); builder.build(); - return builder.getSearch(); + return builder.getSchema(); } } diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/NGramTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/NGramTestCase.java index 0e13aacb76f..1adb909ff21 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/NGramTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/NGramTestCase.java @@ -2,7 +2,7 @@ package com.yahoo.searchdefinition.processing; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.AbstractSchemaTestCase; import com.yahoo.searchdefinition.document.Matching; import com.yahoo.searchdefinition.document.SDField; @@ -25,7 +25,7 @@ public class NGramTestCase extends AbstractSchemaTestCase { @Test public void testNGram() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/ngram.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/ngram.sd"); assertNotNull(schema); SDField gram1 = schema.getConcreteField("gram_1"); @@ -55,7 +55,7 @@ public class NGramTestCase extends AbstractSchemaTestCase { @Test public void testInvalidNGramSetting1() throws IOException, ParseException { try { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/invalidngram1.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/invalidngram1.sd"); fail("Should cause an exception"); } catch (IllegalArgumentException e) { @@ -66,7 +66,7 @@ public class NGramTestCase extends AbstractSchemaTestCase { @Test public void testInvalidNGramSetting2() throws IOException, ParseException { try { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/invalidngram2.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/invalidngram2.sd"); fail("Should cause an exception"); } catch (IllegalArgumentException e) { @@ -77,7 +77,7 @@ public class NGramTestCase extends AbstractSchemaTestCase { @Test public void testInvalidNGramSetting3() throws IOException, ParseException { try { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/invalidngram3.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/invalidngram3.sd"); fail("Should cause an exception"); } catch (IllegalArgumentException e) { diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/PagedAttributeValidatorTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/PagedAttributeValidatorTestCase.java index 360072c1da7..5fce16f381a 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/PagedAttributeValidatorTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/PagedAttributeValidatorTestCase.java @@ -5,7 +5,7 @@ import com.yahoo.searchdefinition.parser.ParseException; import org.junit.Test; import static com.yahoo.config.model.test.TestUtil.joinLines; -import static com.yahoo.searchdefinition.SearchBuilder.createFromString; +import static com.yahoo.searchdefinition.SchemaBuilder.createFromString; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/PositionTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/PositionTestCase.java index 67e47b7f2ae..c3beeeaa17e 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/PositionTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/PositionTestCase.java @@ -5,7 +5,7 @@ import com.yahoo.document.DataType; import com.yahoo.document.DocumentType; import com.yahoo.document.PositionDataType; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.document.Attribute; import com.yahoo.searchdefinition.document.FieldSet; import com.yahoo.vespa.documentmodel.SummaryField; @@ -27,18 +27,18 @@ public class PositionTestCase { @Test public void inherited_position_zcurve_field_is_not_added_to_document_fieldset() throws Exception { - SearchBuilder sb = SearchBuilder.createFromFiles(Arrays.asList( + SchemaBuilder sb = SchemaBuilder.createFromFiles(Arrays.asList( "src/test/examples/position_base.sd", "src/test/examples/position_inherited.sd")); - Schema schema = sb.getSearch("position_inherited"); + Schema schema = sb.getSchema("position_inherited"); FieldSet fieldSet = schema.getDocument().getFieldSets().builtInFieldSets().get(DocumentType.DOCUMENT); assertFalse(fieldSet.getFieldNames().contains(PositionDataType.getZCurveFieldName("pos"))); } @Test public void requireThatPositionCanBeAttribute() throws Exception { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/position_attribute.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/position_attribute.sd"); assertNull(schema.getAttribute("pos")); assertNull(schema.getAttribute("pos.x")); assertNull(schema.getAttribute("pos.y")); @@ -50,7 +50,7 @@ public class PositionTestCase { @Test public void requireThatPositionCanNotBeIndex() throws Exception { try { - SearchBuilder.buildFromFile("src/test/examples/position_index.sd"); + SchemaBuilder.buildFromFile("src/test/examples/position_index.sd"); fail(); } catch (IllegalArgumentException e) { assertEquals("For schema 'position_index', field 'pos': Indexing of data type 'position' is not " + @@ -60,7 +60,7 @@ public class PositionTestCase { @Test public void requireThatSummaryAloneDoesNotCreateZCurve() throws Exception { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/position_summary.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/position_summary.sd"); assertNull(schema.getAttribute("pos")); assertNull(schema.getAttribute("pos.x")); assertNull(schema.getAttribute("pos.y")); @@ -79,7 +79,7 @@ public class PositionTestCase { @Test public void requireThatExtraFieldCanBePositionAttribute() throws Exception { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/position_extra.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/position_extra.sd"); assertNull(schema.getAttribute("pos_ext")); assertNull(schema.getAttribute("pos_ext.x")); assertNull(schema.getAttribute("pos_ext.y")); @@ -90,7 +90,7 @@ public class PositionTestCase { @Test public void requireThatPositionArrayIsSupported() throws Exception { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/position_array.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/position_array.sd"); assertNull(schema.getAttribute("pos")); assertNull(schema.getAttribute("pos.x")); assertNull(schema.getAttribute("pos.y")); diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankModifierTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankModifierTestCase.java index 97eed506c85..87dd92f41d9 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankModifierTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankModifierTestCase.java @@ -2,7 +2,7 @@ package com.yahoo.searchdefinition.processing; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.AbstractSchemaTestCase; import com.yahoo.searchdefinition.parser.ParseException; import org.junit.Test; @@ -17,6 +17,6 @@ import java.io.IOException; public class RankModifierTestCase extends AbstractSchemaTestCase { @Test public void testLiteral() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/rankmodifier/literal.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/rankmodifier/literal.sd"); } } diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankProfileSearchFixture.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankProfileSearchFixture.java index 7ffb20859e9..2707f60f828 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankProfileSearchFixture.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankProfileSearchFixture.java @@ -13,7 +13,7 @@ import com.yahoo.search.query.profile.QueryProfileRegistry; import com.yahoo.searchdefinition.RankProfile; import com.yahoo.searchdefinition.RankProfileRegistry; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.parser.ParseException; import ai.vespa.rankingexpression.importer.configmodelview.ImportedMlModels; import ai.vespa.rankingexpression.importer.onnx.OnnxImporter; @@ -68,7 +68,7 @@ class RankProfileSearchFixture { String rankProfiles, String constant, String field) throws ParseException { this.queryProfileRegistry = queryProfileRegistry; - SearchBuilder builder = new SearchBuilder(applicationpackage, new MockFileRegistry(), new BaseDeployLogger(), new TestProperties(), rankProfileRegistry, queryProfileRegistry); + SchemaBuilder builder = new SchemaBuilder(applicationpackage, new MockFileRegistry(), new BaseDeployLogger(), new TestProperties(), rankProfileRegistry, queryProfileRegistry); String sdContent = "search test {\n" + " " + (constant != null ? constant : "") + "\n" + " document test {\n" + @@ -79,7 +79,7 @@ class RankProfileSearchFixture { "}"; builder.importString(sdContent); builder.build(); - schema = builder.getSearch(); + schema = builder.getSchema(); } public void assertFirstPhaseExpression(String expExpression, String rankProfile) { diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankPropertyVariablesTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankPropertyVariablesTestCase.java index 5c53dbf0c57..b1624b7fd7e 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankPropertyVariablesTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankPropertyVariablesTestCase.java @@ -6,7 +6,7 @@ import com.yahoo.search.query.profile.QueryProfileRegistry; import com.yahoo.searchdefinition.RankProfile.RankProperty; import com.yahoo.searchdefinition.RankProfileRegistry; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.AbstractSchemaTestCase; import com.yahoo.searchdefinition.parser.ParseException; import org.junit.Test; @@ -21,7 +21,7 @@ public class RankPropertyVariablesTestCase extends AbstractSchemaTestCase { @Test public void testRankPropVariables() throws IOException, ParseException { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - Schema schema = SearchBuilder.buildFromFile("src/test/examples/rankpropvars.sd", + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/rankpropvars.sd", new BaseDeployLogger(), rankProfileRegistry, new QueryProfileRegistry()); diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionTypeResolverTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionTypeResolverTestCase.java index 3bdcca52236..4f18c9b68fd 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionTypeResolverTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionTypeResolverTestCase.java @@ -7,7 +7,7 @@ import com.yahoo.search.query.profile.types.QueryProfileType; import com.yahoo.search.query.profile.types.TensorFieldType; import com.yahoo.searchdefinition.RankProfile; import com.yahoo.searchdefinition.RankProfileRegistry; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchlib.rankingexpression.rule.ReferenceNode; import com.yahoo.tensor.TensorType; import com.yahoo.yolean.Exceptions; @@ -33,7 +33,7 @@ public class RankingExpressionTypeResolverTestCase { @Test public void tensorFirstPhaseMustProduceDouble() throws Exception { try { - SearchBuilder builder = new SearchBuilder(); + SchemaBuilder builder = new SchemaBuilder(); builder.importString(joinLines( "search test {", " document test { ", @@ -61,7 +61,7 @@ public class RankingExpressionTypeResolverTestCase { @Test public void tensorFirstPhaseFromConstantMustProduceDouble() throws Exception { try { - SearchBuilder builder = new SearchBuilder(); + SchemaBuilder builder = new SchemaBuilder(); builder.importString(joinLines( "search test {", " document test { ", @@ -110,7 +110,7 @@ public class RankingExpressionTypeResolverTestCase { @Test public void tensorSecondPhaseMustProduceDouble() throws Exception { try { - SearchBuilder builder = new SearchBuilder(); + SchemaBuilder builder = new SchemaBuilder(); builder.importString(joinLines( "search test {", " document test { ", @@ -140,8 +140,8 @@ public class RankingExpressionTypeResolverTestCase { @Test public void tensorConditionsMustHaveTypeCompatibleBranches() throws Exception { try { - SearchBuilder searchBuilder = new SearchBuilder(); - searchBuilder.importString(joinLines( + SchemaBuilder schemaBuilder = new SchemaBuilder(); + schemaBuilder.importString(joinLines( "search test {", " document test { ", " field a type tensor(x[10],y[5]) {", @@ -158,7 +158,7 @@ public class RankingExpressionTypeResolverTestCase { " }", "}" )); - searchBuilder.build(); + schemaBuilder.build(); fail("Expected exception"); } catch (IllegalArgumentException expected) { @@ -172,7 +172,7 @@ public class RankingExpressionTypeResolverTestCase { @Test public void testFunctionInvocationTypes() throws Exception { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder builder = new SearchBuilder(rankProfileRegistry); + SchemaBuilder builder = new SchemaBuilder(rankProfileRegistry); builder.importString(joinLines( "search test {", " document test { ", @@ -196,7 +196,7 @@ public class RankingExpressionTypeResolverTestCase { )); builder.build(); RankProfile profile = - builder.getRankProfileRegistry().get(builder.getSearch(), "my_rank_profile"); + builder.getRankProfileRegistry().get(builder.getSchema(), "my_rank_profile"); assertEquals(TensorType.fromSpec("tensor(x[10],y[3])"), summaryFeatures(profile).get("macro1(a)").type(profile.typeContext(builder.getQueryProfileRegistry()))); assertEquals(TensorType.fromSpec("tensor(z[10])"), @@ -205,7 +205,7 @@ public class RankingExpressionTypeResolverTestCase { @Test public void testTensorFunctionInvocationTypes_Nested() throws Exception { - SearchBuilder builder = new SearchBuilder(); + SchemaBuilder builder = new SchemaBuilder(); builder.importString(joinLines( "search test {", " document test { ", @@ -238,7 +238,7 @@ public class RankingExpressionTypeResolverTestCase { )); builder.build(); RankProfile profile = - builder.getRankProfileRegistry().get(builder.getSearch(), "my_rank_profile"); + builder.getRankProfileRegistry().get(builder.getSchema(), "my_rank_profile"); assertEquals(TensorType.fromSpec("tensor(x[10],y[1])"), summaryFeatures(profile).get("return_a").type(profile.typeContext(builder.getQueryProfileRegistry()))); assertEquals(TensorType.fromSpec("tensor(z[10])"), @@ -247,7 +247,7 @@ public class RankingExpressionTypeResolverTestCase { @Test public void testAttributeInvocationViaBoundIdentifier() throws Exception { - SearchBuilder builder = new SearchBuilder(); + SchemaBuilder builder = new SchemaBuilder(); builder.importString(joinLines( "search newsarticle {", " document newsarticle {", @@ -281,12 +281,12 @@ public class RankingExpressionTypeResolverTestCase { " }", "}")); builder.build(); - RankProfile profile = builder.getRankProfileRegistry().get(builder.getSearch(), "eurank"); + RankProfile profile = builder.getRankProfileRegistry().get(builder.getSchema(), "eurank"); } @Test public void testTensorFunctionInvocationTypes_NestedSameName() throws Exception { - SearchBuilder builder = new SearchBuilder(); + SchemaBuilder builder = new SchemaBuilder(); builder.importString(joinLines( "search test {", " document test { ", @@ -322,7 +322,7 @@ public class RankingExpressionTypeResolverTestCase { )); builder.build(); RankProfile profile = - builder.getRankProfileRegistry().get(builder.getSearch(), "my_rank_profile"); + builder.getRankProfileRegistry().get(builder.getSchema(), "my_rank_profile"); assertEquals(TensorType.fromSpec("tensor(x[10],y[1])"), summaryFeatures(profile).get("return_a").type(profile.typeContext(builder.getQueryProfileRegistry()))); assertEquals(TensorType.fromSpec("tensor(z[10])"), @@ -331,7 +331,7 @@ public class RankingExpressionTypeResolverTestCase { @Test public void testTensorFunctionInvocationTypes_viaFuncWithExpr() throws Exception { - SearchBuilder builder = new SearchBuilder(); + SchemaBuilder builder = new SchemaBuilder(); builder.importString(joinLines( "search test {", " document test {", @@ -346,14 +346,14 @@ public class RankingExpressionTypeResolverTestCase { " }", "}")); builder.build(); - RankProfile profile = builder.getRankProfileRegistry().get(builder.getSearch(), "test"); + RankProfile profile = builder.getRankProfileRegistry().get(builder.getSchema(), "test"); assertEquals(TensorType.fromSpec("tensor<float>(y{})"), summaryFeatures(profile).get("test_func_via_func_with_expr").type(profile.typeContext(builder.getQueryProfileRegistry()))); } @Test public void importedFieldsAreAvailable() throws Exception { - SearchBuilder builder = new SearchBuilder(); + SchemaBuilder builder = new SchemaBuilder(); builder.importString(joinLines( "search parent {", " document parent {", @@ -384,7 +384,7 @@ public class RankingExpressionTypeResolverTestCase { @Test public void undeclaredQueryFeaturesAreAccepted() throws Exception { InspectableDeployLogger logger = new InspectableDeployLogger(); - SearchBuilder builder = new SearchBuilder(logger); + SchemaBuilder builder = new SchemaBuilder(logger); builder.importString(joinLines( "search test {", " document test { ", @@ -410,7 +410,7 @@ public class RankingExpressionTypeResolverTestCase { @Test public void undeclaredQueryFeaturesAreAcceptedWithWarningWhenUsingTensors() throws Exception { InspectableDeployLogger logger = new InspectableDeployLogger(); - SearchBuilder builder = new SearchBuilder(logger); + SchemaBuilder builder = new SchemaBuilder(logger); builder.importString(joinLines( "search test {", " document test { ", @@ -439,7 +439,7 @@ public class RankingExpressionTypeResolverTestCase { @Test public void noWarningWhenUsingTensorsWhenQueryFeaturesAreDeclared() throws Exception { InspectableDeployLogger logger = new InspectableDeployLogger(); - SearchBuilder builder = new SearchBuilder(logger); + SchemaBuilder builder = new SchemaBuilder(logger); QueryProfileType myType = new QueryProfileType("mytype"); myType.addField(new FieldDescription("rank.feature.query(foo)", new TensorFieldType(TensorType.fromSpec("tensor(d[2])"))), diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionWithTransformerTokensTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionWithTransformerTokensTestCase.java index e77787e22ca..93de116883a 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionWithTransformerTokensTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionWithTransformerTokensTestCase.java @@ -9,7 +9,7 @@ import com.yahoo.search.query.profile.QueryProfileRegistry; import com.yahoo.searchdefinition.RankProfile; import com.yahoo.searchdefinition.RankProfileRegistry; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.expressiontransforms.RankProfileTransformContext; import com.yahoo.searchdefinition.expressiontransforms.TokenTransformer; import com.yahoo.searchdefinition.parser.ParseException; @@ -87,10 +87,10 @@ public class RankingExpressionWithTransformerTokensTestCase { " document test {}\n" + " rank-profile my_profile inherits default {}\n" + "}"; - SearchBuilder searchBuilder = new SearchBuilder(application, new MockFileRegistry(), new BaseDeployLogger(), new TestProperties(), rankProfileRegistry, queryProfileRegistry); - searchBuilder.importString(sdContent); - searchBuilder.build(); - Schema schema = searchBuilder.getSearch(); + SchemaBuilder schemaBuilder = new SchemaBuilder(application, new MockFileRegistry(), new BaseDeployLogger(), new TestProperties(), rankProfileRegistry, queryProfileRegistry); + schemaBuilder.importString(sdContent); + schemaBuilder.build(); + Schema schema = schemaBuilder.getSchema(); RankProfile rp = rankProfileRegistry.get(schema, "my_profile"); return new RankProfileTransformContext(rp, queryProfileRegistry, Collections.emptyMap(), null, Collections.emptyMap(), Collections.emptyMap()); } 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 fc5a2b6a39a..ebc8ceacc50 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 @@ -11,7 +11,7 @@ import com.yahoo.searchdefinition.RankProfile; import com.yahoo.searchdefinition.RankProfileRegistry; import com.yahoo.searchdefinition.Schema; import com.yahoo.searchdefinition.AbstractSchemaTestCase; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.derived.DerivedConfiguration; import com.yahoo.searchdefinition.derived.AttributeFields; import com.yahoo.searchdefinition.derived.RawRankProfile; @@ -31,7 +31,7 @@ import static org.junit.Assert.assertTrue; public class RankingExpressionsTestCase extends AbstractSchemaTestCase { private static Schema createSearch(String dir, ModelContext.Properties deployProperties, RankProfileRegistry rankProfileRegistry) throws IOException, ParseException { - return SearchBuilder.createFromDirectory(dir, new MockFileRegistry(), new TestableDeployLogger(), deployProperties, rankProfileRegistry).getSearch(); + return SchemaBuilder.createFromDirectory(dir, new MockFileRegistry(), new TestableDeployLogger(), deployProperties, rankProfileRegistry).getSchema(); } @Test diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/ReferenceFieldTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/ReferenceFieldTestCase.java index 41b9d480921..e8564d0875d 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/ReferenceFieldTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/ReferenceFieldTestCase.java @@ -6,7 +6,7 @@ import com.yahoo.document.Field; import com.yahoo.document.ReferenceDataType; import com.yahoo.searchdefinition.DocumentGraphValidator; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.document.SDDocumentType; import com.yahoo.searchdefinition.parser.ParseException; import org.junit.Rule; @@ -28,7 +28,7 @@ public class ReferenceFieldTestCase { @Test public void reference_fields_are_parsed_from_search_definition() throws ParseException { - SearchBuilder builder = new SearchBuilder(); + SchemaBuilder builder = new SchemaBuilder(); String campaignSdContent = "search campaign {\n" + " document campaign {\n" + @@ -50,14 +50,14 @@ public class ReferenceFieldTestCase { builder.importString(salespersonSdContent); builder.importString(adSdContent); builder.build(); - Schema schema = builder.getSearch("ad"); + Schema schema = builder.getSchema("ad"); assertSearchContainsReferenceField("campaign_ref", "campaign", schema.getDocument()); assertSearchContainsReferenceField("salesperson_ref", "salesperson", schema.getDocument()); } @Test public void cyclic_document_dependencies_are_detected() throws ParseException { - SearchBuilder builder = new SearchBuilder(); + SchemaBuilder builder = new SchemaBuilder(); String campaignSdContent = "search campaign {\n" + " document campaign {\n" + diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/ReservedRankingExpressionFunctionNamesTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/ReservedRankingExpressionFunctionNamesTestCase.java index 481acace535..922680e8f1a 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/ReservedRankingExpressionFunctionNamesTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/ReservedRankingExpressionFunctionNamesTestCase.java @@ -3,7 +3,7 @@ package com.yahoo.searchdefinition.processing; import com.yahoo.config.application.api.DeployLogger; import com.yahoo.searchdefinition.RankProfileRegistry; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.parser.ParseException; import org.junit.Test; @@ -21,7 +21,7 @@ public class ReservedRankingExpressionFunctionNamesTestCase { public void requireThatFunctionsWithReservedNamesIssueAWarning() throws ParseException { TestDeployLogger deployLogger = new TestDeployLogger(); RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder builder = new SearchBuilder(deployLogger, rankProfileRegistry); + SchemaBuilder builder = new SchemaBuilder(deployLogger, rankProfileRegistry); builder.importString( "search test {\n" + " document test { \n" + diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/SchemaMustHaveDocumentTest.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/SchemaMustHaveDocumentTest.java index 34572280d01..24dc98e4d93 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/SchemaMustHaveDocumentTest.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/SchemaMustHaveDocumentTest.java @@ -1,7 +1,7 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.searchdefinition.processing; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.parser.ParseException; import org.junit.Test; @@ -17,7 +17,7 @@ public class SchemaMustHaveDocumentTest { @Test public void requireErrorWhenMissingDocument() throws IOException, ParseException { try { - SearchBuilder.buildFromFile("src/test/examples/invalid_sd_missing_document.sd"); + SchemaBuilder.buildFromFile("src/test/examples/invalid_sd_missing_document.sd"); fail("SD without document"); } catch (IllegalArgumentException e) { if (!e.getMessage() diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/SummaryConsistencyTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/SummaryConsistencyTestCase.java index e0593aef1e3..145295a7c49 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/SummaryConsistencyTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/SummaryConsistencyTestCase.java @@ -2,7 +2,7 @@ package com.yahoo.searchdefinition.processing; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.parser.ParseException; import com.yahoo.vespa.documentmodel.SummaryTransform; import org.junit.Test; @@ -39,7 +39,7 @@ public class SummaryConsistencyTestCase { "", "}" ); - Schema schema = SearchBuilder.createFromString(sd).getSearch(); + Schema schema = SchemaBuilder.createFromString(sd).getSchema(); assertEquals(SummaryTransform.ATTRIBUTECOMBINER, schema.getSummaryField("elem_array_unfiltered").getTransform()); } } diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/SummaryFieldsMustHaveValidSourceTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/SummaryFieldsMustHaveValidSourceTestCase.java index 014ca4ec5e9..eb3e61b9f7a 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/SummaryFieldsMustHaveValidSourceTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/SummaryFieldsMustHaveValidSourceTestCase.java @@ -5,7 +5,7 @@ import com.yahoo.config.model.application.provider.BaseDeployLogger; import com.yahoo.searchdefinition.RankProfileRegistry; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.AbstractSchemaTestCase; import com.yahoo.searchdefinition.parser.ParseException; import com.yahoo.vespa.model.container.search.QueryProfiles; @@ -21,7 +21,7 @@ public class SummaryFieldsMustHaveValidSourceTestCase extends AbstractSchemaTest @Test public void requireThatInvalidSourceIsCaught() throws IOException, ParseException { try { - SearchBuilder.buildFromFile("src/test/examples/invalidsummarysource.sd"); + SchemaBuilder.buildFromFile("src/test/examples/invalidsummarysource.sd"); fail("This should throw and never get here"); } catch (IllegalArgumentException e) { assertEquals("For schema 'invalidsummarysource', summary class 'baz', summary field 'cox': there is no valid source 'nonexistingfield'.", e.getMessage()); @@ -31,7 +31,7 @@ public class SummaryFieldsMustHaveValidSourceTestCase extends AbstractSchemaTest @Test public void requireThatInvalidImplicitSourceIsCaught() throws IOException, ParseException { try { - SearchBuilder.buildFromFile("src/test/examples/invalidimplicitsummarysource.sd"); + SchemaBuilder.buildFromFile("src/test/examples/invalidimplicitsummarysource.sd"); fail("This should throw and never get here"); } catch (IllegalArgumentException e) { assertEquals("For schema 'invalidsummarysource', summary class 'baz', summary field 'cox': there is no valid source 'cox'.", e.getMessage()); @@ -41,7 +41,7 @@ public class SummaryFieldsMustHaveValidSourceTestCase extends AbstractSchemaTest @Test public void requireThatInvalidSelfReferingSingleSource() throws IOException, ParseException { try { - SearchBuilder.buildFromFile("src/test/examples/invalidselfreferringsummary.sd"); + SchemaBuilder.buildFromFile("src/test/examples/invalidselfreferringsummary.sd"); fail("This should throw and never get here"); } catch (IllegalArgumentException e) { assertEquals("For schema 'invalidselfreferringsummary', summary class 'withid', summary field 'w': there is no valid source 'w'.", e.getMessage()); @@ -50,7 +50,7 @@ public class SummaryFieldsMustHaveValidSourceTestCase extends AbstractSchemaTest @Test public void requireThatDocumentIdIsAllowedToPass() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/documentidinsummary.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/documentidinsummary.sd"); BaseDeployLogger deployLogger = new BaseDeployLogger(); RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); new SummaryFieldsMustHaveValidSource(schema, deployLogger, rankProfileRegistry, new QueryProfiles()).process(true, false); diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/TensorFieldTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/TensorFieldTestCase.java index cef00346fe7..82b288dc66d 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/TensorFieldTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/TensorFieldTestCase.java @@ -1,13 +1,12 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.searchdefinition.processing; -import com.yahoo.config.model.test.TestUtil; import com.yahoo.searchdefinition.document.Attribute; import com.yahoo.searchdefinition.parser.ParseException; import org.junit.Test; -import static com.yahoo.searchdefinition.SearchBuilder.createFromString; +import static com.yahoo.searchdefinition.SchemaBuilder.createFromString; import static com.yahoo.config.model.test.TestUtil.joinLines; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -138,12 +137,12 @@ public class TensorFieldTestCase { } private Attribute getAttributeFromSd(String fieldSpec, String attrName) throws ParseException { - return createFromString(getSd(fieldSpec)).getSearch().getAttribute(attrName); + return createFromString(getSd(fieldSpec)).getSchema().getAttribute(attrName); } private void assertHnswIndexParams(String indexSpec, int maxLinksPerNode, int neighborsToExploreAtInsert) throws ParseException { var sd = getSdWithIndexSpec(indexSpec); - var search = createFromString(sd).getSearch(); + var search = createFromString(sd).getSchema(); var attr = search.getAttribute("t1"); var params = attr.hnswIndexParams(); assertTrue(params.isPresent()); diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/TensorTransformTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/TensorTransformTestCase.java index 888cd22c1c3..eec2ef4c3a0 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/TensorTransformTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/TensorTransformTestCase.java @@ -14,7 +14,7 @@ import com.yahoo.searchdefinition.LargeRankExpressions; import com.yahoo.searchdefinition.RankProfile; import com.yahoo.searchdefinition.RankProfileRegistry; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.AbstractSchemaTestCase; import com.yahoo.searchdefinition.derived.AttributeFields; import com.yahoo.searchdefinition.derived.RawRankProfile; @@ -140,7 +140,7 @@ public class TensorTransformTestCase extends AbstractSchemaTestCase { private List<Pair<String, String>> buildSearch(String expression) throws ParseException { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); QueryProfileRegistry queryProfiles = setupQueryProfileTypes(); - SearchBuilder builder = new SearchBuilder(rankProfileRegistry, queryProfiles); + SchemaBuilder builder = new SchemaBuilder(rankProfileRegistry, queryProfiles); builder.importString( "search test {\n" + " document test { \n" + @@ -198,7 +198,7 @@ public class TensorTransformTestCase extends AbstractSchemaTestCase { " }\n" + "}\n"); builder.build(true); - Schema s = builder.getSearch(); + Schema s = builder.getSchema(); RankProfile test = rankProfileRegistry.get(s, "test").compile(queryProfiles, new ImportedMlModels()); List<Pair<String, String>> testRankProperties = new RawRankProfile(test, new LargeRankExpressions(new MockFileRegistry()), diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/WeightedSetSummaryToTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/WeightedSetSummaryToTestCase.java index e9aec9b7293..2a737f4eb69 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/WeightedSetSummaryToTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/WeightedSetSummaryToTestCase.java @@ -2,7 +2,7 @@ package com.yahoo.searchdefinition.processing; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.AbstractSchemaTestCase; import com.yahoo.searchdefinition.parser.ParseException; import org.junit.Test; @@ -16,7 +16,7 @@ public class WeightedSetSummaryToTestCase extends AbstractSchemaTestCase { @Test public void testRequireThatImplicitFieldsAreCreated() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/weightedset-summaryto.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/weightedset-summaryto.sd"); assertNotNull(schema); } diff --git a/config-model/src/test/java/com/yahoo/vespa/documentmodel/DocumentModelBuilderImportedFieldsTestCase.java b/config-model/src/test/java/com/yahoo/vespa/documentmodel/DocumentModelBuilderImportedFieldsTestCase.java index 599ae77a456..26ddc8ede8f 100644 --- a/config-model/src/test/java/com/yahoo/vespa/documentmodel/DocumentModelBuilderImportedFieldsTestCase.java +++ b/config-model/src/test/java/com/yahoo/vespa/documentmodel/DocumentModelBuilderImportedFieldsTestCase.java @@ -1,7 +1,7 @@ // Copyright 2020 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.documentmodel; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.parser.ParseException; import org.junit.Test; @@ -27,7 +27,7 @@ public class DocumentModelBuilderImportedFieldsTestCase extends AbstractReferenc } private static class TestDocumentModelBuilder { - private final SearchBuilder builder = new SearchBuilder(); + private final SchemaBuilder builder = new SchemaBuilder(); public TestDocumentModelBuilder addCampaign() throws ParseException { builder.importString(joinLines("search campaign {", " document campaign {", diff --git a/config-model/src/test/java/com/yahoo/vespa/documentmodel/DocumentModelBuilderReferenceTypeTestCase.java b/config-model/src/test/java/com/yahoo/vespa/documentmodel/DocumentModelBuilderReferenceTypeTestCase.java index 189b514c294..f9b9bf2610e 100644 --- a/config-model/src/test/java/com/yahoo/vespa/documentmodel/DocumentModelBuilderReferenceTypeTestCase.java +++ b/config-model/src/test/java/com/yahoo/vespa/documentmodel/DocumentModelBuilderReferenceTypeTestCase.java @@ -3,7 +3,7 @@ package com.yahoo.vespa.documentmodel; import com.yahoo.document.ReferenceDataType; import com.yahoo.documentmodel.NewDocumentType; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.parser.ParseException; import org.junit.Test; @@ -56,7 +56,7 @@ public class DocumentModelBuilderReferenceTypeTestCase extends AbstractReference } private static class TestDocumentModelBuilder { - private final SearchBuilder builder = new SearchBuilder(); + private final SchemaBuilder builder = new SchemaBuilder(); public TestDocumentModelBuilder addCampaign() throws ParseException { builder.importString(joinLines("search campaign {", " document campaign {}", diff --git a/config-model/src/test/java/com/yahoo/vespa/documentmodel/DocumentModelBuilderTestCase.java b/config-model/src/test/java/com/yahoo/vespa/documentmodel/DocumentModelBuilderTestCase.java index 15de4b8c02e..79893385199 100644 --- a/config-model/src/test/java/com/yahoo/vespa/documentmodel/DocumentModelBuilderTestCase.java +++ b/config-model/src/test/java/com/yahoo/vespa/documentmodel/DocumentModelBuilderTestCase.java @@ -3,7 +3,7 @@ package com.yahoo.vespa.documentmodel; import com.yahoo.document.DocumenttypesConfig; import com.yahoo.document.config.DocumentmanagerConfig; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.AbstractSchemaTestCase; import com.yahoo.searchdefinition.parser.ParseException; import com.yahoo.vespa.configmodel.producers.DocumentManager; @@ -35,7 +35,7 @@ public class DocumentModelBuilderTestCase extends AbstractSchemaTestCase { @Test public void testDocumentTypesWithDocumentField() throws IOException, ParseException { - SearchBuilder search = new SearchBuilder(); + SchemaBuilder search = new SchemaBuilder(); search.importFile("src/test/configmodel/types/other_doc.sd"); search.importFile("src/test/configmodel/types/type_with_doc_field.sd"); search.build(); @@ -48,7 +48,7 @@ public class DocumentModelBuilderTestCase extends AbstractSchemaTestCase { @Test public void testMultipleInheritanceArray() throws IOException, ParseException { - SearchBuilder search = new SearchBuilder(); + SchemaBuilder search = new SchemaBuilder(); search.importFile("src/test/cfg/search/data/travel/schemas/TTData.sd"); search.importFile("src/test/cfg/search/data/travel/schemas/TTEdge.sd"); search.importFile("src/test/cfg/search/data/travel/schemas/TTPOI.sd"); @@ -56,7 +56,7 @@ public class DocumentModelBuilderTestCase extends AbstractSchemaTestCase { } private DocumentModel createAndTestModel(String sd) throws IOException, ParseException { - SearchBuilder search = SearchBuilder.createFromFile(sd); + SchemaBuilder search = SchemaBuilder.createFromFile(sd); DocumentModel model = search.getModel(); assertEquals(2, model.getDocumentManager().getTypes().size()); diff --git a/config-model/src/test/java/com/yahoo/vespa/model/search/test/SchemaClusterTest.java b/config-model/src/test/java/com/yahoo/vespa/model/search/test/SchemaClusterTest.java index 27dda6a6bb2..6830ce79f9f 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/search/test/SchemaClusterTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/search/test/SchemaClusterTest.java @@ -6,7 +6,7 @@ import com.yahoo.container.QrSearchersConfig; import com.yahoo.document.DataType; import com.yahoo.search.config.ClusterConfig; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.document.Attribute; import com.yahoo.searchdefinition.document.SDDocumentType; import com.yahoo.searchdefinition.document.SDField; @@ -56,9 +56,9 @@ public class SchemaClusterTest { sdt2.addField(f2); schema2.addDocument(sdt2); - SearchBuilder builder = new SearchBuilder(); - builder.importRawSearch(schema1); - builder.importRawSearch(schema2); + SchemaBuilder builder = new SchemaBuilder(); + builder.importRawSchema(schema1); + builder.importRawSchema(schema2); builder.build(); } |