diff options
author | Jon Bratseth <bratseth@gmail.com> | 2021-10-15 17:58:13 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2021-10-15 17:58:13 +0200 |
commit | 813c270c2ea80953c7b09aac56dc6a5c254aca1e (patch) | |
tree | 272ba9fe3a0e7f94e30f7bd5e130eb9c9f4edad9 /config-model/src/main/javacc/SDParser.jj | |
parent | 3a755750ba601440cee41d2f19d4370e2817b3c1 (diff) |
Add Application abstraction
Diffstat (limited to 'config-model/src/main/javacc/SDParser.jj')
-rw-r--r-- | config-model/src/main/javacc/SDParser.jj | 15 |
1 files changed, 9 insertions, 6 deletions
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> ) |