diff options
author | Tor Egge <Tor.Egge@online.no> | 2024-03-07 12:42:46 +0100 |
---|---|---|
committer | Tor Egge <Tor.Egge@online.no> | 2024-03-07 12:42:46 +0100 |
commit | 773b4413e773d5fe96e6609d306126c706f1444b (patch) | |
tree | 6a29572010527246de6f454c591e123f9b1f2704 /config-model | |
parent | 3baf9596fb7733d0eeb9330b7396cb68d9d458b7 (diff) |
Don't add streaming search cluster for documents only schema.
Diffstat (limited to 'config-model')
-rw-r--r-- | config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java index cd3103d20ab..125d3b10512 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java @@ -130,6 +130,16 @@ public class ContentSearchCluster extends TreeConfigProducer<AnyConfigProducer> return clusterElem.childAsDouble("engine.proton.query-timeout"); } + private static Schema findResponsibleSchema(DeployState deployState, String docTypeName) { + var schemas = deployState.getSchemas(); + for (var candidate : schemas) { + if (candidate.getName().equals(docTypeName)) { + return candidate; + } + } + return null; + } + private void buildAllStreamingSearchClusters(DeployState deployState, ModelElement clusterElem, String clusterName, ContentSearchCluster search) { ModelElement docElem = clusterElem.child("documents"); @@ -138,8 +148,10 @@ public class ContentSearchCluster extends TreeConfigProducer<AnyConfigProducer> } for (ModelElement docType : docElem.subElements("document")) { + String docTypeName = docType.stringAttribute("type"); String mode = docType.stringAttribute("mode"); - if ("streaming".equals(mode)) { + var schema = findResponsibleSchema(deployState, docTypeName); + if ("streaming".equals(mode) && schema != null && !schema.isDocumentsOnly()) { buildStreamingSearchCluster(deployState, clusterElem, clusterName, search, docType); } } |