diff options
Diffstat (limited to 'container-search/src/main')
16 files changed, 67 insertions, 41 deletions
diff --git a/container-search/src/main/java/com/yahoo/prelude/fastsearch/DocumentDatabase.java b/container-search/src/main/java/com/yahoo/prelude/fastsearch/DocumentDatabase.java index f35559ad2f4..67038e0e771 100644 --- a/container-search/src/main/java/com/yahoo/prelude/fastsearch/DocumentDatabase.java +++ b/container-search/src/main/java/com/yahoo/prelude/fastsearch/DocumentDatabase.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.prelude.fastsearch; -import com.yahoo.search.config.RankProfile; +import com.yahoo.search.schema.RankProfile; import com.yahoo.tensor.TensorType; import java.util.ArrayList; diff --git a/container-search/src/main/java/com/yahoo/prelude/fastsearch/VespaBackEndSearcher.java b/container-search/src/main/java/com/yahoo/prelude/fastsearch/VespaBackEndSearcher.java index a6da823d990..3847e80d3c7 100644 --- a/container-search/src/main/java/com/yahoo/prelude/fastsearch/VespaBackEndSearcher.java +++ b/container-search/src/main/java/com/yahoo/prelude/fastsearch/VespaBackEndSearcher.java @@ -14,7 +14,7 @@ import com.yahoo.protect.Validator; import com.yahoo.search.Query; import com.yahoo.search.Result; import com.yahoo.search.cluster.PingableSearcher; -import com.yahoo.search.config.RankProfile; +import com.yahoo.search.schema.RankProfile; import com.yahoo.search.grouping.vespa.GroupingExecutor; import com.yahoo.search.result.ErrorMessage; import com.yahoo.search.result.Hit; diff --git a/container-search/src/main/java/com/yahoo/search/Query.java b/container-search/src/main/java/com/yahoo/search/Query.java index 354881c763b..5e46815a152 100644 --- a/container-search/src/main/java/com/yahoo/search/Query.java +++ b/container-search/src/main/java/com/yahoo/search/Query.java @@ -13,7 +13,7 @@ import com.yahoo.prelude.fastsearch.DocumentDatabase; import com.yahoo.prelude.query.Highlight; import com.yahoo.prelude.query.textualrepresentation.TextualQueryRepresentation; import com.yahoo.processing.request.CompoundName; -import com.yahoo.search.config.SchemaInfo; +import com.yahoo.search.schema.SchemaInfo; import com.yahoo.search.dispatch.Dispatcher; import com.yahoo.search.dispatch.rpc.ProtobufSerialization; import com.yahoo.search.federation.FederationSearcher; @@ -60,7 +60,6 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Optional; import java.util.Set; import java.util.concurrent.TimeUnit; import java.util.logging.Level; diff --git a/container-search/src/main/java/com/yahoo/search/config/package-info.java b/container-search/src/main/java/com/yahoo/search/config/package-info.java index dd9c7bfcf04..bdfc1ce9790 100644 --- a/container-search/src/main/java/com/yahoo/search/config/package-info.java +++ b/container-search/src/main/java/com/yahoo/search/config/package-info.java @@ -1,11 +1,6 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. @ExportPackage -@PublicApi package com.yahoo.search.config; -import com.yahoo.api.annotations.PublicApi; import com.yahoo.osgi.annotation.ExportPackage; -/** - * Information about the current configuration this is running as a part of. - */
\ No newline at end of file diff --git a/container-search/src/main/java/com/yahoo/search/query/Model.java b/container-search/src/main/java/com/yahoo/search/query/Model.java index 82cda9e8a1b..1b12f3f3bb8 100644 --- a/container-search/src/main/java/com/yahoo/search/query/Model.java +++ b/container-search/src/main/java/com/yahoo/search/query/Model.java @@ -10,7 +10,7 @@ import com.yahoo.prelude.query.TaggableItem; import com.yahoo.processing.IllegalInputException; import com.yahoo.processing.request.CompoundName; import com.yahoo.search.Query; -import com.yahoo.search.config.SchemaInfo; +import com.yahoo.search.schema.SchemaInfo; import com.yahoo.search.query.parser.Parsable; import com.yahoo.search.query.parser.Parser; import com.yahoo.search.query.parser.ParserEnvironment; diff --git a/container-search/src/main/java/com/yahoo/search/query/profile/types/TensorFieldType.java b/container-search/src/main/java/com/yahoo/search/query/profile/types/TensorFieldType.java index e0dea744075..ccb9b2d0676 100644 --- a/container-search/src/main/java/com/yahoo/search/query/profile/types/TensorFieldType.java +++ b/container-search/src/main/java/com/yahoo/search/query/profile/types/TensorFieldType.java @@ -2,7 +2,7 @@ package com.yahoo.search.query.profile.types; import com.yahoo.processing.request.Properties; -import com.yahoo.search.config.internal.TensorConverter; +import com.yahoo.search.schema.internal.TensorConverter; import com.yahoo.search.query.profile.QueryProfileRegistry; import com.yahoo.search.query.profile.SubstituteString; import com.yahoo.tensor.Tensor; diff --git a/container-search/src/main/java/com/yahoo/search/query/properties/RankProfileInputProperties.java b/container-search/src/main/java/com/yahoo/search/query/properties/RankProfileInputProperties.java index 7f4cee07e8c..6c65a5e898a 100644 --- a/container-search/src/main/java/com/yahoo/search/query/properties/RankProfileInputProperties.java +++ b/container-search/src/main/java/com/yahoo/search/query/properties/RankProfileInputProperties.java @@ -5,10 +5,9 @@ import com.yahoo.api.annotations.Beta; import com.yahoo.language.process.Embedder; import com.yahoo.processing.request.CompoundName; import com.yahoo.search.Query; -import com.yahoo.search.config.SchemaInfo; -import com.yahoo.search.config.internal.TensorConverter; +import com.yahoo.search.schema.SchemaInfo; +import com.yahoo.search.schema.internal.TensorConverter; import com.yahoo.search.query.Properties; -import com.yahoo.search.query.Ranking; import com.yahoo.search.query.ranking.RankFeatures; import com.yahoo.tensor.Tensor; import com.yahoo.tensor.TensorType; diff --git a/container-search/src/main/java/com/yahoo/search/config/RankProfile.java b/container-search/src/main/java/com/yahoo/search/schema/RankProfile.java index 944a23f2964..8267e5c937b 100644 --- a/container-search/src/main/java/com/yahoo/search/config/RankProfile.java +++ b/container-search/src/main/java/com/yahoo/search/schema/RankProfile.java @@ -1,5 +1,5 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.search.config; +package com.yahoo.search.schema; import com.yahoo.tensor.TensorType; diff --git a/container-search/src/main/java/com/yahoo/search/config/Schema.java b/container-search/src/main/java/com/yahoo/search/schema/Schema.java index 57712c731f4..b66e6ce957a 100644 --- a/container-search/src/main/java/com/yahoo/search/config/Schema.java +++ b/container-search/src/main/java/com/yahoo/search/schema/Schema.java @@ -1,5 +1,5 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.search.config; +package com.yahoo.search.schema; import com.yahoo.api.annotations.Beta; diff --git a/container-search/src/main/java/com/yahoo/search/config/SchemaInfo.java b/container-search/src/main/java/com/yahoo/search/schema/SchemaInfo.java index 746f1c340f2..2d1d391640f 100644 --- a/container-search/src/main/java/com/yahoo/search/config/SchemaInfo.java +++ b/container-search/src/main/java/com/yahoo/search/schema/SchemaInfo.java @@ -1,11 +1,11 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.search.config; +package com.yahoo.search.schema; import com.yahoo.api.annotations.Beta; -import com.yahoo.component.annotation.Inject; import com.yahoo.container.QrSearchersConfig; -import com.yahoo.prelude.fastsearch.DocumentdbInfoConfig; import com.yahoo.search.Query; +import com.yahoo.search.config.IndexInfoConfig; +import com.yahoo.search.config.SchemaInfoConfig; import com.yahoo.tensor.TensorType; import java.util.HashSet; @@ -44,11 +44,10 @@ public class SchemaInfo { /** The schemas contained in each content cluster indexed by cluster name */ private final Map<String, List<String>> clusters; - @Inject public SchemaInfo(IndexInfoConfig indexInfo, // will be used in the future - DocumentdbInfoConfig documentdbInfoConfig, + SchemaInfoConfig schemaInfoConfig, QrSearchersConfig qrSearchersConfig) { - this(SchemaInfoConfigurer.toSchemas(documentdbInfoConfig), SchemaInfoConfigurer.toClusters(qrSearchersConfig)); + this(SchemaInfoConfigurer.toSchemas(schemaInfoConfig), SchemaInfoConfigurer.toClusters(qrSearchersConfig)); } public SchemaInfo(List<Schema> schemas, Map<String, List<String>> clusters) { diff --git a/container-search/src/main/java/com/yahoo/search/config/SchemaInfoConfigurer.java b/container-search/src/main/java/com/yahoo/search/schema/SchemaInfoConfigurer.java index ae06babda66..84ed9ae8e3d 100644 --- a/container-search/src/main/java/com/yahoo/search/config/SchemaInfoConfigurer.java +++ b/container-search/src/main/java/com/yahoo/search/schema/SchemaInfoConfigurer.java @@ -1,12 +1,11 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.search.config; +package com.yahoo.search.schema; import com.yahoo.container.QrSearchersConfig; -import com.yahoo.prelude.fastsearch.DocumentdbInfoConfig; +import com.yahoo.search.config.SchemaInfoConfig; import com.yahoo.tensor.TensorType; import java.util.ArrayList; -import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -19,13 +18,13 @@ import java.util.stream.Collectors; */ class SchemaInfoConfigurer { - static List<Schema> toSchemas(DocumentdbInfoConfig documentdbInfoConfig) { - return documentdbInfoConfig.documentdb().stream().map(config -> toSchema(config)).collect(Collectors.toList()); + static List<Schema> toSchemas(SchemaInfoConfig schemaInfoConfig) { + return schemaInfoConfig.schema().stream().map(config -> toSchema(config)).collect(Collectors.toList()); } - static Schema toSchema(DocumentdbInfoConfig.Documentdb documentDbConfig) { - Schema.Builder builder = new Schema.Builder(documentDbConfig.name()); - for (var profileConfig : documentDbConfig.rankprofile()) { + static Schema toSchema(SchemaInfoConfig.Schema schemaInfoConfig) { + Schema.Builder builder = new Schema.Builder(schemaInfoConfig.name()); + for (var profileConfig : schemaInfoConfig.rankprofile()) { RankProfile.Builder profileBuilder = new RankProfile.Builder(profileConfig.name()); profileBuilder.setHasSummaryFeatures(profileConfig.hasSummaryFeatures()); profileBuilder.setHasRankFeatures(profileConfig.hasRankFeatures()); diff --git a/container-search/src/main/java/com/yahoo/search/config/internal/TensorConverter.java b/container-search/src/main/java/com/yahoo/search/schema/internal/TensorConverter.java index fbe2ffb8984..2370513dba2 100644 --- a/container-search/src/main/java/com/yahoo/search/config/internal/TensorConverter.java +++ b/container-search/src/main/java/com/yahoo/search/schema/internal/TensorConverter.java @@ -1,5 +1,5 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.search.config.internal; +package com.yahoo.search.schema.internal; import com.yahoo.language.Language; import com.yahoo.language.process.Embedder; diff --git a/container-search/src/main/java/com/yahoo/search/schema/package-info.java b/container-search/src/main/java/com/yahoo/search/schema/package-info.java new file mode 100644 index 00000000000..f9c86afc3e1 --- /dev/null +++ b/container-search/src/main/java/com/yahoo/search/schema/package-info.java @@ -0,0 +1,11 @@ +// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +@ExportPackage +@PublicApi +package com.yahoo.search.schema; + +import com.yahoo.api.annotations.PublicApi; +import com.yahoo.osgi.annotation.ExportPackage; + +/** + * Information about the current configuration this is running as a part of. + */
\ No newline at end of file diff --git a/container-search/src/main/java/com/yahoo/search/searchchain/Execution.java b/container-search/src/main/java/com/yahoo/search/searchchain/Execution.java index baf9f35c72b..aba72cb3404 100644 --- a/container-search/src/main/java/com/yahoo/search/searchchain/Execution.java +++ b/container-search/src/main/java/com/yahoo/search/searchchain/Execution.java @@ -16,8 +16,7 @@ import com.yahoo.search.Query; import com.yahoo.search.Result; import com.yahoo.search.Searcher; import com.yahoo.search.cluster.PingableSearcher; -import com.yahoo.search.config.SchemaInfo; -import com.yahoo.search.rendering.Renderer; +import com.yahoo.search.schema.SchemaInfo; import com.yahoo.search.rendering.RendererRegistry; import com.yahoo.search.statistics.TimeTracker; import java.util.Objects; @@ -140,7 +139,7 @@ public class Execution extends com.yahoo.processing.execution.Execution { public Context(SearchChainRegistry searchChainRegistry, IndexFacts indexFacts, SpecialTokenRegistry tokenRegistry, RendererRegistry rendererRegistry, Linguistics linguistics, Executor executor) { - this(searchChainRegistry, indexFacts, SchemaInfo.empty(), tokenRegistry, rendererRegistry, linguistics, Runnable::run); + this(searchChainRegistry, indexFacts, SchemaInfo.empty(), tokenRegistry, rendererRegistry, linguistics, executor); } /** @deprecated pass an executor */ diff --git a/container-search/src/main/java/com/yahoo/search/searchchain/ExecutionFactory.java b/container-search/src/main/java/com/yahoo/search/searchchain/ExecutionFactory.java index 06814a4c436..54874dbee3e 100644 --- a/container-search/src/main/java/com/yahoo/search/searchchain/ExecutionFactory.java +++ b/container-search/src/main/java/com/yahoo/search/searchchain/ExecutionFactory.java @@ -11,16 +11,16 @@ import com.yahoo.component.provider.ComponentRegistry; import com.yahoo.concurrent.ThreadFactoryFactory; import com.yahoo.container.QrSearchersConfig; import com.yahoo.container.core.ChainsConfig; +import com.yahoo.search.config.SchemaInfoConfig; import com.yahoo.language.Linguistics; import com.yahoo.language.simple.SimpleLinguistics; import com.yahoo.prelude.IndexFacts; import com.yahoo.prelude.IndexModel; import com.yahoo.language.process.SpecialTokenRegistry; -import com.yahoo.prelude.fastsearch.DocumentdbInfoConfig; import com.yahoo.processing.rendering.Renderer; import com.yahoo.search.Searcher; import com.yahoo.search.config.IndexInfoConfig; -import com.yahoo.search.config.SchemaInfo; +import com.yahoo.search.schema.SchemaInfo; import com.yahoo.search.rendering.RendererRegistry; import com.yahoo.vespa.configdefinition.SpecialtokensConfig; @@ -51,7 +51,7 @@ public class ExecutionFactory extends AbstractComponent { @Inject public ExecutionFactory(ChainsConfig chainsConfig, IndexInfoConfig indexInfo, - DocumentdbInfoConfig documentdbInfo, + SchemaInfoConfig schemaInfo, QrSearchersConfig clusters, ComponentRegistry<Searcher> searchers, SpecialtokensConfig specialTokens, @@ -60,7 +60,7 @@ public class ExecutionFactory extends AbstractComponent { Executor executor) { this.searchChainRegistry = createSearchChainRegistry(searchers, chainsConfig); this.indexFacts = new IndexFacts(new IndexModel(indexInfo, clusters)).freeze(); - this.schemaInfo = new SchemaInfo(indexInfo, documentdbInfo, clusters); + this.schemaInfo = new SchemaInfo(indexInfo, schemaInfo, clusters); this.specialTokens = new SpecialTokenRegistry(specialTokens); this.linguistics = linguistics; this.renderingExecutor = createRenderingExecutor(); @@ -78,7 +78,7 @@ public class ExecutionFactory extends AbstractComponent { Linguistics linguistics, ComponentRegistry<Renderer> renderers, Executor executor) { - this(chainsConfig, indexInfo, new DocumentdbInfoConfig.Builder().build(), clusters, searchers, specialTokens, linguistics, renderers, executor); + this(chainsConfig, indexInfo, new SchemaInfoConfig.Builder().build(), clusters, searchers, specialTokens, linguistics, renderers, executor); } /** @deprecated pass the container threadpool */ @@ -90,7 +90,7 @@ public class ExecutionFactory extends AbstractComponent { SpecialtokensConfig specialTokens, Linguistics linguistics, ComponentRegistry<Renderer> renderers) { - this(chainsConfig, indexInfo, new DocumentdbInfoConfig.Builder().build(), clusters, searchers, specialTokens, linguistics, renderers, null); + this(chainsConfig, indexInfo, new SchemaInfoConfig.Builder().build(), clusters, searchers, specialTokens, linguistics, renderers, null); } private SearchChainRegistry createSearchChainRegistry(ComponentRegistry<Searcher> searchers, @@ -144,7 +144,7 @@ public class ExecutionFactory extends AbstractComponent { public static ExecutionFactory empty() { return new ExecutionFactory(new ChainsConfig.Builder().build(), new IndexInfoConfig.Builder().build(), - new DocumentdbInfoConfig.Builder().build(), + new SchemaInfoConfig.Builder().build(), new QrSearchersConfig.Builder().build(), new ComponentRegistry<>(), new SpecialtokensConfig.Builder().build(), diff --git a/container-search/src/main/resources/configdefinitions/container.search.schema-info.def b/container-search/src/main/resources/configdefinitions/container.search.schema-info.def new file mode 100644 index 00000000000..e5b14db9b4e --- /dev/null +++ b/container-search/src/main/resources/configdefinitions/container.search.schema-info.def @@ -0,0 +1,25 @@ +# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +namespace=search.config + +## The name of this schema +schema[].name string + +## The id of the summary class +# schema[].summaryclass[].id int +## The name of the summary class +# schema[].summaryclass[].name string +## The name of a field in the summary class +# schema[].summaryclass[].fields[].name string +## The type of a field in the summary class +# schema[].summaryclass[].fields[].type string +## Whether this field is a dynamic snippet +# schema[].summaryclass[].fields[].dynamic bool default=false + +## Information about rank profiles +schema[].rankprofile[].name string +schema[].rankprofile[].hasSummaryFeatures bool default=true +schema[].rankprofile[].hasRankFeatures bool default=true +# The name of an input (query rank feature) accepted by this profile +schema[].rankprofile[].input[].name string +# The tensor type of an input (query rank feature) accepted by this profile +schema[].rankprofile[].input[].type string |