summaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorGeir Storli <geirst@vespa.ai>2024-03-07 17:14:24 +0100
committerGitHub <noreply@github.com>2024-03-07 17:14:24 +0100
commit49c877a85db591193bdd69a0a623108da9b72de3 (patch)
treee9f06b630e578c6825b06bc2dc09c3c6aef3eea3 /config-model
parent38a38c0e7bbd14cb6197477c127089b6dced6e83 (diff)
parent773b4413e773d5fe96e6609d306126c706f1444b (diff)
Merge pull request #30506 from vespa-engine/toregge/dont-add-streaming-search-cluster-for-documents-only-schema
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.java14
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);
}
}