From 5516fe8a61fe7de37c7cfbd6e8e9e07c6db0a08c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20J=C3=A4ckle?= Date: Thu, 3 Sep 2026 14:53:21 +0200 Subject: [PATCH] Render Helm customIndexes at the config path Ditto actually reads MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `thingsSearch.config.customIndexes` never reached Ditto. The template emitted the block under ditto.search.updater.persistence.custom-indexes while SearchConfigValue declares CUSTOM_INDEXES("index-initialization.custom-indexes", Collections.emptyMap()) so DittoSearchConfig#loadCustomIndexes looks under `ditto.search.index-initialization.custom-indexes` and finds nothing. search.conf documents the same location - `custom-indexes {}` sits inside the `index-initialization { }` block, next to `activated-index-names`. The consequence is worse than the feature silently doing nothing. Because IndexInitializer.dropUndefinedIndices() removes every index whose name is neither built-in nor a *configured* custom index, declaring an index in the chart made Ditto drop it on startup rather than create and keep it. Operators who had pre-created the index by hand - the recommended approach on a large collection, where a rolling build avoids a cold create - lost it on the next things-search restart. Observed on a cluster after deploying a chart that declared two custom indexes: index-initialization is aware of defined indices: [_namespace, global_read, v_wildcard, v_wildcard_id] Dropping undefined indices: [ns_currently_mounted, ns_type_usagetype] Index-Initialization was successful. The fix is positional only: move the block inside `index-initialization`. The emitted HOCON shape ("name" { fields = [ { name, direction } ] }) already matched search.conf and is unchanged. Verified by rendering the chart with a customIndexes value: the block is now nested in index-initialization, no stray `updater { }` block remains, and a render without customIndexes emits no custom-indexes at all. Co-Authored-By: Claude Opus 5 (1M context) Signed-off-by: Thomas Jäckle --- deployment/helm/ditto/CHANGELOG.md | 12 ++++++++++++ deployment/helm/ditto/Chart.yaml | 2 +- .../ditto/service-config/search-extension.conf.tpl | 7 +------ 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/deployment/helm/ditto/CHANGELOG.md b/deployment/helm/ditto/CHANGELOG.md index 1a991feadc..f6940e4368 100644 --- a/deployment/helm/ditto/CHANGELOG.md +++ b/deployment/helm/ditto/CHANGELOG.md @@ -15,6 +15,18 @@ sections: `Added`, `Changed`, `Deprecated`, `Removed`, `Fixed`, `Security`. ## [Unreleased] +## [4.7.1] + +### Fixed +- `thingsSearch.config.customIndexes` never reached Ditto: the template rendered the block under + `ditto.search.updater.persistence.custom-indexes`, while `SearchConfigValue.CUSTOM_INDEXES` declares the + path `index-initialization.custom-indexes` (as documented in `search.conf`, where `custom-indexes` sits + inside the `index-initialization` block next to `activated-index-names`). Because + `IndexInitializer.dropUndefinedIndices()` removes every index that is neither built-in nor a *configured* + custom index, declaring a custom index made Ditto **drop** it on startup instead of creating and keeping + it. Operators who had pre-created the index manually lost it on the next things-search restart. The fix + is positional only — the emitted HOCON shape is unchanged + ## [4.7.0] Bumped Ditto `appVersion` to `3.9.7`. diff --git a/deployment/helm/ditto/Chart.yaml b/deployment/helm/ditto/Chart.yaml index 6611047596..62fa88c489 100644 --- a/deployment/helm/ditto/Chart.yaml +++ b/deployment/helm/ditto/Chart.yaml @@ -16,7 +16,7 @@ description: | A digital twin is a virtual, cloud based, representation of his real world counterpart (real world “Things”, e.g. devices like sensors, smart heating, connected cars, smart grids, EV charging stations etc). type: application -version: 4.7.0 # chart version is effectively set by release-job +version: 4.7.1 # chart version is effectively set by release-job appVersion: 3.9.7 keywords: - iot-chart diff --git a/deployment/helm/ditto/service-config/search-extension.conf.tpl b/deployment/helm/ditto/service-config/search-extension.conf.tpl index 5c1e824dbb..7cb9f4fedd 100644 --- a/deployment/helm/ditto/service-config/search-extension.conf.tpl +++ b/deployment/helm/ditto/service-config/search-extension.conf.tpl @@ -40,11 +40,7 @@ ditto { {{- end }} ] {{- end }} - } - {{- if .Values.thingsSearch.config.customIndexes }} - updater { - persistence { custom-indexes { {{- range $indexName, $fields := .Values.thingsSearch.config.customIndexes }} "{{$indexName}}" { @@ -56,9 +52,8 @@ ditto { } {{- end }} } - } - } {{- end }} + } {{- if .Values.thingsSearch.config.indexedFieldsLimiting.enabled }} namespace-indexed-fields = [