aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2021-10-15 17:58:13 +0200
committerJon Bratseth <bratseth@gmail.com>2021-10-15 17:58:13 +0200
commit813c270c2ea80953c7b09aac56dc6a5c254aca1e (patch)
tree272ba9fe3a0e7f94e30f7bd5e130eb9c9f4edad9
parent3a755750ba601440cee41d2f19d4370e2817b3c1 (diff)
Add Application abstraction
-rw-r--r--config-model/src/main/java/com/yahoo/searchdefinition/Application.java54
-rw-r--r--config-model/src/main/java/com/yahoo/searchdefinition/DocumentOnlySearch.java4
-rw-r--r--config-model/src/main/java/com/yahoo/searchdefinition/DocumentReferenceResolver.java5
-rw-r--r--config-model/src/main/java/com/yahoo/searchdefinition/ImportedFieldsEnumerator.java5
-rw-r--r--config-model/src/main/java/com/yahoo/searchdefinition/Search.java57
-rw-r--r--config-model/src/main/java/com/yahoo/searchdefinition/SearchBuilder.java44
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/documentmodel/DocumentSummary.java2
-rw-r--r--config-model/src/main/javacc/SDParser.jj15
-rw-r--r--config-model/src/test/java/com/yahoo/searchdefinition/SummaryTestCase.java30
-rw-r--r--config-model/src/test/java/com/yahoo/searchdefinition/derived/VsmFieldsTestCase.java3
-rw-r--r--config-model/src/test/java/com/yahoo/searchdefinition/processing/AddAttributeTransformToSummaryOfImportedFieldsTest.java3
-rw-r--r--config-model/src/test/java/com/yahoo/searchdefinition/processing/ParentChildSearchModel.java6
-rw-r--r--config-model/src/test/java/com/yahoo/searchdefinition/processing/ValidateFieldTypesTest.java3
13 files changed, 173 insertions, 58 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/Application.java b/config-model/src/main/java/com/yahoo/searchdefinition/Application.java
new file mode 100644
index 00000000000..5eb28201239
--- /dev/null
+++ b/config-model/src/main/java/com/yahoo/searchdefinition/Application.java
@@ -0,0 +1,54 @@
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package com.yahoo.searchdefinition;
+
+import com.yahoo.config.application.api.ApplicationPackage;
+import com.yahoo.config.application.api.DeployLogger;
+
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * A collection of objects representing the content of an application package.
+ * This is created, then added to, and lastly validated when there is no more content to add.
+ * At that point it is ready to use for deriving configuration.
+ *
+ * @author bratseth
+ */
+public class Application {
+
+ private final ApplicationPackage applicationPackage;
+ private final Map<String, Search> schemas = new LinkedHashMap<>();
+
+ public Application(ApplicationPackage applicationPackage) {
+ this.applicationPackage = applicationPackage;
+ }
+
+ public ApplicationPackage applicationPackage() { return applicationPackage; }
+
+ public void add(Search schema) {
+ if (schemas.containsKey(schema.getName()))
+ throw new IllegalArgumentException("Duplicate schema '" + schema.getName() + "' in " + this);
+ schemas.put(schema.getName(), schema);
+ }
+
+ /** Returns an unmodifiable list of the schemas of this application */
+ public Map<String, Search> schemas() { return Collections.unmodifiableMap(schemas); }
+
+ /** Used by SearchBuilder, for now */
+ void replaceSchemasBy(List<Search> schemas) {
+ this.schemas.clear();
+ for (var schema : schemas)
+ this.schemas.put(schema.getName(), schema);
+ }
+
+ /** Validates this. Must be called after all content is added to it. */
+ public void validate(DeployLogger logger) {
+ schemas.values().forEach(schema -> schema.validate(logger));
+ }
+
+ @Override
+ public String toString() { return "application " + applicationPackage.getApplicationId(); }
+
+}
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/DocumentOnlySearch.java b/config-model/src/main/java/com/yahoo/searchdefinition/DocumentOnlySearch.java
index d10aa26f429..29d8252f621 100644
--- a/config-model/src/main/java/com/yahoo/searchdefinition/DocumentOnlySearch.java
+++ b/config-model/src/main/java/com/yahoo/searchdefinition/DocumentOnlySearch.java
@@ -15,8 +15,8 @@ import com.yahoo.searchdefinition.document.SDDocumentType;
*/
public class DocumentOnlySearch extends Search {
- public DocumentOnlySearch(ApplicationPackage applicationPackage, FileRegistry fileRegistry, DeployLogger deployLogger, ModelContext.Properties properties) {
- super(applicationPackage, fileRegistry, deployLogger, properties);
+ public DocumentOnlySearch(Application application, FileRegistry fileRegistry, DeployLogger deployLogger, ModelContext.Properties properties) {
+ super(application, fileRegistry, deployLogger, properties);
}
@Override
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/DocumentReferenceResolver.java b/config-model/src/main/java/com/yahoo/searchdefinition/DocumentReferenceResolver.java
index 95fdd5dc297..a16433b36dc 100644
--- a/config-model/src/main/java/com/yahoo/searchdefinition/DocumentReferenceResolver.java
+++ b/config-model/src/main/java/com/yahoo/searchdefinition/DocumentReferenceResolver.java
@@ -7,7 +7,6 @@ import com.yahoo.searchdefinition.document.SDDocumentType;
import com.yahoo.searchdefinition.document.SDField;
import java.util.Collection;
-import java.util.List;
import java.util.Map;
import java.util.stream.Stream;
@@ -26,7 +25,7 @@ public class DocumentReferenceResolver {
private final Map<String, Search> searchMapping;
- public DocumentReferenceResolver(List<Search> schemas) {
+ public DocumentReferenceResolver(Collection<Search> schemas) {
this.searchMapping = createDocumentNameToSearchMapping(schemas);
}
@@ -78,7 +77,7 @@ public class DocumentReferenceResolver {
return sdField.doesAttributing();
}
- private static Map<String, Search> createDocumentNameToSearchMapping(List<Search> searchDefintions) {
+ private static Map<String, Search> createDocumentNameToSearchMapping(Collection<Search> searchDefintions) {
return searchDefintions.stream()
.filter(search -> search.getDocument() != null)
.collect(toMap(search -> search.getDocument().getName(), identity()));
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/ImportedFieldsEnumerator.java b/config-model/src/main/java/com/yahoo/searchdefinition/ImportedFieldsEnumerator.java
index 25cdd1e08cd..91fd0aee957 100644
--- a/config-model/src/main/java/com/yahoo/searchdefinition/ImportedFieldsEnumerator.java
+++ b/config-model/src/main/java/com/yahoo/searchdefinition/ImportedFieldsEnumerator.java
@@ -3,6 +3,7 @@ package com.yahoo.searchdefinition;
import com.yahoo.searchdefinition.document.SDDocumentType;
+import java.util.Collection;
import java.util.List;
/**
@@ -11,9 +12,9 @@ import java.util.List;
*/
public class ImportedFieldsEnumerator {
- private final List<Search> schemas;
+ private final Collection<Search> schemas;
- public ImportedFieldsEnumerator(List<Search> schemas) {
+ public ImportedFieldsEnumerator(Collection<Search> schemas) {
this.schemas = schemas;
}
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/Search.java b/config-model/src/main/java/com/yahoo/searchdefinition/Search.java
index 415fcd1d34e..0b7b1687eb9 100644
--- a/config-model/src/main/java/com/yahoo/searchdefinition/Search.java
+++ b/config-model/src/main/java/com/yahoo/searchdefinition/Search.java
@@ -59,9 +59,12 @@ public class Search implements ImmutableSearch {
private final FieldSets fieldSets = new FieldSets();
- /** The unique name of this search definition */
+ /** The unique name of this schema */
private String name;
+ /** The name of the schema this should inherit all the content of, if any */
+ private final Optional<String> inherited;
+
/** True if this doesn't define a search, just a document type */
private final boolean documentsOnly;
@@ -94,31 +97,52 @@ public class Search implements ImmutableSearch {
private Optional<TemporaryImportedFields> temporaryImportedFields = Optional.of(new TemporaryImportedFields());
private Optional<ImportedFields> importedFields = Optional.empty();
- private final ApplicationPackage applicationPackage;
+ private final Application application;
private final DeployLogger deployLogger;
private final ModelContext.Properties properties;
/** Testing only */
public Search(String name) {
- this(name, null, null, new BaseDeployLogger(), new TestProperties());
+ this(name, Optional.empty(), null, null, new BaseDeployLogger(), new TestProperties());
+ }
+
+ public Search(String name,
+ Application application,
+ FileRegistry fileRegistry,
+ DeployLogger deployLogger,
+ ModelContext.Properties properties) {
+ this(name, Optional.empty(), application, fileRegistry, deployLogger, properties);
}
+
/**
- * Creates a proper search definition
+ * Creates a schema
*
- * @param name of the the searchdefinition
- * @param applicationPackage the application containing this
+ * @param name of the schema
+ * @param inherited the schema this inherits, if any
+ * @param application the application containing this
*/
- public Search(String name, ApplicationPackage applicationPackage, FileRegistry fileRegistry, DeployLogger deployLogger, ModelContext.Properties properties) {
- this(applicationPackage, fileRegistry, deployLogger, properties, false);
+ public Search(String name,
+ Optional<String> inherited,
+ Application application,
+ FileRegistry fileRegistry,
+ DeployLogger deployLogger,
+ ModelContext.Properties properties) {
+ this(inherited, application, fileRegistry, deployLogger, properties, false);
this.name = name;
}
- protected Search(ApplicationPackage applicationPackage, FileRegistry fileRegistry, DeployLogger deployLogger, ModelContext.Properties properties) {
- this(applicationPackage, fileRegistry, deployLogger, properties, true);
+ protected Search(Application application, FileRegistry fileRegistry, DeployLogger deployLogger, ModelContext.Properties properties) {
+ this(Optional.empty(), application, fileRegistry, deployLogger, properties, true);
}
- private Search(ApplicationPackage applicationPackage, FileRegistry fileRegistry, DeployLogger deployLogger, ModelContext.Properties properties, boolean documentsOnly) {
- this.applicationPackage = applicationPackage;
+ private Search(Optional<String> inherited,
+ Application application,
+ FileRegistry fileRegistry,
+ DeployLogger deployLogger,
+ ModelContext.Properties properties,
+ boolean documentsOnly) {
+ this.inherited = inherited;
+ this.application = application;
this.deployLogger = deployLogger;
this.properties = properties;
this.documentsOnly = documentsOnly;
@@ -299,11 +323,16 @@ public class Search implements ImmutableSearch {
*/
@Override
public Reader getRankingExpression(String fileName) {
- return applicationPackage.getRankingExpression(fileName);
+ return application.applicationPackage().getRankingExpression(fileName);
}
+ public Application application() { return application; }
+
@Override
- public ApplicationPackage applicationPackage() { return applicationPackage; }
+ public ApplicationPackage applicationPackage() {
+ if (application == null) return null;
+ return application.applicationPackage();
+ }
@Override
public DeployLogger getDeployLogger() { return deployLogger; }
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/SearchBuilder.java b/config-model/src/main/java/com/yahoo/searchdefinition/SearchBuilder.java
index 0f7ead43868..adfed2e8147 100644
--- a/config-model/src/main/java/com/yahoo/searchdefinition/SearchBuilder.java
+++ b/config-model/src/main/java/com/yahoo/searchdefinition/SearchBuilder.java
@@ -42,11 +42,12 @@ import java.util.List;
* expressions, using the setRankXXX() methods, 3) invoke the {@link #build()} method, and 4) retrieve the built
* search objects using the {@link #getSearch(String)} method.
*/
+// Since this was created we have added Application, and much of the content in this should probably migrate there.
public class SearchBuilder {
private final DocumentTypeManager docTypeMgr = new DocumentTypeManager();
private final DocumentModel model = new DocumentModel();
- private final ApplicationPackage app;
+ private final Application application;
private final RankProfileRegistry rankProfileRegistry;
private final QueryProfileRegistry queryProfileRegistry;
private final FileRegistry fileRegistry;
@@ -109,14 +110,14 @@ public class SearchBuilder {
QueryProfileRegistry queryProfileRegistry) {
this(app, fileRegistry, deployLogger, properties, rankProfileRegistry, queryProfileRegistry, false);
}
- private SearchBuilder(ApplicationPackage app,
+ private SearchBuilder(ApplicationPackage applicationPackage,
FileRegistry fileRegistry,
DeployLogger deployLogger,
ModelContext.Properties properties,
RankProfileRegistry rankProfileRegistry,
QueryProfileRegistry queryProfileRegistry,
boolean documentsOnly) {
- this.app = app;
+ this.application = new Application(applicationPackage);
this.rankProfileRegistry = rankProfileRegistry;
this.queryProfileRegistry = queryProfileRegistry;
this.fileRegistry = fileRegistry;
@@ -169,7 +170,7 @@ public class SearchBuilder {
private String importString(String str, String searchDefDir) throws ParseException {
SimpleCharStream stream = new SimpleCharStream(str);
try {
- return importRawSearch(new SDParser(stream, fileRegistry, deployLogger, properties, app, rankProfileRegistry, documentsOnly)
+ return importRawSearch(new SDParser(stream, fileRegistry, deployLogger, properties, application, rankProfileRegistry, documentsOnly)
.search(docTypeMgr, searchDefDir));
} catch (TokenMgrException e) {
throw new ParseException("Unknown symbol: " + e.getMessage());
@@ -183,21 +184,16 @@ public class SearchBuilder {
* {@link Search} object is considered to be "raw" if it has not already been processed. This is the case for most
* programmatically constructed search objects used in unit tests.
*
- * @param rawSearch the object to import.
+ * @param schema the object to import.
* @return the name of the imported object.
* @throws IllegalArgumentException if the given search object has already been processed.
*/
- public String importRawSearch(Search rawSearch) {
- if (rawSearch.getName() == null)
- throw new IllegalArgumentException("Search has no name.");
- String rawName = rawSearch.getName();
- for (Search search : searchList) {
- if (rawName.equals(search.getName())) {
- throw new IllegalArgumentException("A search definition with a search section called '" + rawName +
- "' has already been added.");
- }
- }
- searchList.add(rawSearch);
+ public String importRawSearch(Search schema) {
+ if (schema.getName() == null)
+ throw new IllegalArgumentException("Schema has no name");
+ String rawName = schema.getName();
+ application.add(schema);
+ searchList.add(schema);
return rawName;
}
@@ -223,7 +219,7 @@ public class SearchBuilder {
if (isBuilt) throw new IllegalStateException("Model already built");
if (validate)
- searchList.forEach(search -> search.validate(deployLogger));
+ application.validate(deployLogger);
List<Search> built = new ArrayList<>();
List<SDDocumentType> sdocs = new ArrayList<>();
@@ -282,10 +278,11 @@ public class SearchBuilder {
*/
public Search getSearch() {
if ( ! isBuilt) throw new IllegalStateException("Searches not built.");
- if (searchList.size() != 1)
- throw new IllegalStateException("This call only works if we have 1 search definition. Search definitions: " + searchList);
+ if (application.schemas().size() != 1)
+ throw new IllegalStateException("This call only works if we have 1 schema. Schemas: " +
+ application.schemas().values());
- return searchList.get(0);
+ return application.schemas().values().stream().findAny().get();
}
public DocumentModel getModel() {
@@ -304,16 +301,13 @@ public class SearchBuilder {
public Search getSearch(String name) {
if ( ! isBuilt) throw new IllegalStateException("Searches not built.");
if (name == null) return getSearch();
-
- for (Search search : searchList)
- if (search.getName().equals(name)) return search;
- return null;
+ return application.schemas().get(name);
}
/**
* Convenience method to return a list of all built {@link Search} objects.
*
- * @return The list of built searches.
+ * @return the list of built searches
*/
public List<Search> getSearchList() {
return new ArrayList<>(searchList);
diff --git a/config-model/src/main/java/com/yahoo/vespa/documentmodel/DocumentSummary.java b/config-model/src/main/java/com/yahoo/vespa/documentmodel/DocumentSummary.java
index 23c1a48b6fe..67e26a899bd 100644
--- a/config-model/src/main/java/com/yahoo/vespa/documentmodel/DocumentSummary.java
+++ b/config-model/src/main/java/com/yahoo/vespa/documentmodel/DocumentSummary.java
@@ -109,7 +109,7 @@ public class DocumentSummary extends FieldView {
return owner.getSummary(inherited);
}
- /** Returns the name of the summary this was declared to inherit, or null if not sett to inherit anything */
+ /** Returns the name of the summary this was declared to inherit, or null if not set to inherit anything */
public String getInheritedName() {
return inherited;
}
diff --git a/config-model/src/main/javacc/SDParser.jj b/config-model/src/main/javacc/SDParser.jj
index 19bea494347..f2b94991145 100644
--- a/config-model/src/main/javacc/SDParser.jj
+++ b/config-model/src/main/javacc/SDParser.jj
@@ -28,6 +28,7 @@ import com.yahoo.document.*;
import com.yahoo.documentmodel.*;
import com.yahoo.compress.Compressor;
import com.yahoo.compress.CompressionType;
+import com.yahoo.searchdefinition.Application;
import com.yahoo.searchdefinition.document.*;
import com.yahoo.searchdefinition.document.annotation.SDAnnotationType;
import com.yahoo.searchdefinition.document.annotation.TemporaryAnnotationReferenceDataType;
@@ -61,6 +62,7 @@ import com.yahoo.language.Linguistics;
import com.yahoo.language.process.Embedder;
import com.yahoo.language.simple.SimpleLinguistics;
import com.yahoo.search.query.ranking.Diversity;
+import java.util.Optional;
import java.util.Map;
import java.util.List;
import java.util.ArrayList;
@@ -76,7 +78,7 @@ import java.util.logging.Level;
public class SDParser {
private DocumentTypeManager docMan = null;
- private ApplicationPackage app;
+ private Application application;
private FileRegistry fileRegistry;
private DeployLogger deployLogger;
private ModelContext.Properties properties;
@@ -92,14 +94,14 @@ public class SDParser {
FileRegistry fileRegistry,
DeployLogger deployLogger,
ModelContext.Properties properties,
- ApplicationPackage applicationPackage,
+ Application application,
RankProfileRegistry rankProfileRegistry,
boolean documentsOnly) {
this(stream);
this.fileRegistry = fileRegistry;
this.deployLogger = deployLogger;
this.properties = properties;
- this.app = applicationPackage;
+ this.application = application;
this.rankProfileRegistry = rankProfileRegistry;
this.documentsOnly = documentsOnly;
}
@@ -437,11 +439,12 @@ Search search(DocumentTypeManager docMan, String dir) :
Search rootSchema(String dir) :
{
String name;
+ String inherited = null;
Search search;
}
{
- ( ( <SCHEMA> | <SEARCH> ) name = identifier() {
- search = new Search(name, app, fileRegistry,deployLogger, properties);
+ ( ( <SCHEMA> | <SEARCH> ) name = identifier() (<INHERITS> inherited = identifier() )? {
+ search = new Search(name, Optional.ofNullable(inherited), application, fileRegistry, deployLogger, properties);
rankProfileRegistry.add(new DefaultRankProfile(search, rankProfileRegistry, search.rankingConstants()));
rankProfileRegistry.add(new UnrankedRankProfile(search, rankProfileRegistry, search.rankingConstants()));}
lbrace() (rootSchemaItem(search) (<NL>)*)* <RBRACE> (<NL>)* <EOF>)
@@ -482,7 +485,7 @@ Object rootSchemaItem(Search search) : { }
*/
Search rootDocument(String dir) :
{
- Search search = new DocumentOnlySearch(app, fileRegistry, deployLogger, properties);
+ Search search = new DocumentOnlySearch(application, fileRegistry, deployLogger, properties);
}
{
( (rootDocumentItem(search) (<NL>)*)*<EOF> )
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 35a775d7ad5..52e155fc9a5 100644
--- a/config-model/src/test/java/com/yahoo/searchdefinition/SummaryTestCase.java
+++ b/config-model/src/test/java/com/yahoo/searchdefinition/SummaryTestCase.java
@@ -238,6 +238,36 @@ public class SummaryTestCase {
}
}
+ @Test
+ public void testInheritingParentSummary() throws ParseException {
+ String parent = joinLines(
+ "schema parent {" +
+ " document parent {" +
+ " field pf1 type string {" +
+ " indexing: summary" +
+ " }" +
+ " }" +
+ " document-summary parent_summary {" +
+ " summary pf1 type string {}" +
+ " }" +
+ "}");
+ String child = joinLines(
+ "schema child inherits parent {" +
+ " document child inherits parent {" +
+ " field cf1 type string {" +
+ " indexing: summary" +
+ " }" +
+ " }" +
+ " document-summary child_summary inherits parent_summary {" +
+ " summary cf1 type string {}" +
+ " }" +
+ "}");
+ DeployLoggerStub logger = new DeployLoggerStub();
+ SearchBuilder.createFromStrings(logger, parent, child);
+ logger.entries.forEach(e -> System.out.println(e));
+ //assertTrue(logger.entries.isEmpty());
+ }
+
private static class TestValue {
private final DocumentSummary summary;
diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/VsmFieldsTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/VsmFieldsTestCase.java
index 32c22b583d6..3e3904fa250 100644
--- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/VsmFieldsTestCase.java
+++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/VsmFieldsTestCase.java
@@ -6,6 +6,7 @@ import com.yahoo.config.model.deploy.TestProperties;
import com.yahoo.config.model.test.MockApplicationPackage;
import com.yahoo.document.ReferenceDataType;
import com.yahoo.document.TemporaryStructuredDataType;
+import com.yahoo.searchdefinition.Application;
import com.yahoo.searchdefinition.Search;
import com.yahoo.searchdefinition.document.SDDocumentType;
import com.yahoo.searchdefinition.document.SDField;
@@ -22,7 +23,7 @@ public class VsmFieldsTestCase {
@Test
public void reference_type_field_is_unsearchable() {
- Search search = new Search("test", MockApplicationPackage.createEmpty(), new MockFileRegistry(), new TestableDeployLogger(), new TestProperties());
+ Search search = new Search("test", new Application(MockApplicationPackage.createEmpty()), new MockFileRegistry(), new TestableDeployLogger(), new TestProperties());
search.addDocument(new SDDocumentType("test"));
SDField refField = new TemporarySDField("ref_field", ReferenceDataType.createWithInferredId(TemporaryStructuredDataType.create("parent_type")));
refField.parseIndexingScript("{ summary }");
diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/AddAttributeTransformToSummaryOfImportedFieldsTest.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/AddAttributeTransformToSummaryOfImportedFieldsTest.java
index f0fab8e4810..d7b31af11b8 100644
--- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/AddAttributeTransformToSummaryOfImportedFieldsTest.java
+++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/AddAttributeTransformToSummaryOfImportedFieldsTest.java
@@ -6,6 +6,7 @@ import com.yahoo.config.model.deploy.TestProperties;
import com.yahoo.config.model.test.MockApplicationPackage;
import com.yahoo.document.DataType;
import com.yahoo.document.Field;
+import com.yahoo.searchdefinition.Application;
import com.yahoo.searchdefinition.DocumentReference;
import com.yahoo.searchdefinition.Search;
import com.yahoo.searchdefinition.derived.TestableDeployLogger;
@@ -47,7 +48,7 @@ public class AddAttributeTransformToSummaryOfImportedFieldsTest {
}
private static Search createSearch(String documentType) {
- return new Search(documentType, MockApplicationPackage.createEmpty(), new MockFileRegistry(), new TestableDeployLogger(), new TestProperties());
+ return new Search(documentType, new Application(MockApplicationPackage.createEmpty()), new MockFileRegistry(), new TestableDeployLogger(), new TestProperties());
}
private static Search createSearchWithDocument(String documentName) {
diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/ParentChildSearchModel.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/ParentChildSearchModel.java
index 6366be84d8e..59f0916f912 100644
--- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/ParentChildSearchModel.java
+++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/ParentChildSearchModel.java
@@ -9,6 +9,7 @@ import com.yahoo.config.model.test.MockApplicationPackage;
import com.yahoo.document.DataType;
import com.yahoo.document.ReferenceDataType;
import com.yahoo.document.TemporaryStructuredDataType;
+import com.yahoo.searchdefinition.Application;
import com.yahoo.searchdefinition.DocumentReference;
import com.yahoo.searchdefinition.DocumentReferences;
import com.yahoo.searchdefinition.Search;
@@ -22,7 +23,8 @@ import com.yahoo.searchdefinition.document.TemporarySDField;
* Fixture class used for ImportedFieldsResolverTestCase and AdjustPositionSummaryFieldsTestCase.
*/
public class ParentChildSearchModel {
- private final ApplicationPackage app = MockApplicationPackage.createEmpty();
+
+ private final Application application = new Application(MockApplicationPackage.createEmpty());
public Search parentSearch;
public Search childSearch;
@@ -32,7 +34,7 @@ public class ParentChildSearchModel {
}
protected Search createSearch(String name) {
- Search result = new Search(name, app, new MockFileRegistry(), new TestableDeployLogger(), new TestProperties());
+ Search result = new Search(name, application, new MockFileRegistry(), new TestableDeployLogger(), new TestProperties());
result.addDocument(new SDDocumentType(name));
return result;
}
diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/ValidateFieldTypesTest.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/ValidateFieldTypesTest.java
index c7b9ce16338..ab6a547d9e5 100644
--- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/ValidateFieldTypesTest.java
+++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/ValidateFieldTypesTest.java
@@ -6,6 +6,7 @@ import com.yahoo.config.model.deploy.TestProperties;
import com.yahoo.config.model.test.MockApplicationPackage;
import com.yahoo.document.DataType;
import com.yahoo.document.Field;
+import com.yahoo.searchdefinition.Application;
import com.yahoo.searchdefinition.DocumentReference;
import com.yahoo.searchdefinition.Search;
import com.yahoo.searchdefinition.derived.TestableDeployLogger;
@@ -48,7 +49,7 @@ public class ValidateFieldTypesTest {
}
private static Search createSearch(String documentType) {
- return new Search(documentType, MockApplicationPackage.createEmpty(), new MockFileRegistry(), new TestableDeployLogger(), new TestProperties());
+ return new Search(documentType, new Application(MockApplicationPackage.createEmpty()), new MockFileRegistry(), new TestableDeployLogger(), new TestProperties());
}
private static Search createSearchWithDocument(String documentName) {