From 773b4413e773d5fe96e6609d306126c706f1444b Mon Sep 17 00:00:00 2001 From: Tor Egge Date: Thu, 7 Mar 2024 12:42:46 +0100 Subject: Don't add streaming search cluster for documents only schema. --- .../yahoo/vespa/model/content/ContentSearchCluster.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'config-model/src/main/java/com') 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 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 } 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); } } -- cgit v1.2.3