You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Elasticsearch connection string scope key has no effect on index names #2696
ElasticsearchOptions parses a scope key from ConnectionStrings:Elasticsearch, but index names are built from ScopePrefix, which is computed from AppScope before the connection string is parsed. Setting scope= in the Elasticsearch connection string changes nothing.
ParseConnectionString overwrites Scope from the scope key but never recomputes ScopePrefix.
Every index uses ScopePrefix, e.g. EventIndex and the migrations index. Nothing reads ElasticsearchOptions.Scope for the main cluster.
The only reader of Scope is DataMigrationJob, for ElasticsearchToMigrate, where it is used as a raw prefix with no - separator (scope=prod gives prodorganizations-v1, while the main cluster's prefix would be prod-).
Steps to reproduce
Run with EX_ConnectionStrings__Elasticsearch=server=http://localhost:9200;scope=test and no EX_AppScope.
List indexes: they are events-v1-*, stacks-v1, organizations-v1, etc., without a test- prefix.
Expected
Either scope in the Elasticsearch connection string prefixes index names the same way AppScope does, or the key is not parsed at all.
Suggested fix
Set ScopePrefix at the end of ParseConnectionString (ScopePrefix = String.IsNullOrEmpty(Scope) ? "" : $"{Scope}-"), so both the main and ElasticsearchToMigrate options get it, and compute the EnableSnapshotJobs default after parsing, since it depends on ScopePrefix. In DataMigrationJob, use ElasticsearchToMigrate.ScopePrefix so both sides use the same - separator. If per-connection scoping isn't wanted, remove the scope parsing for the main connection string and keep it only for ElasticsearchToMigrate.
Closing. AppScope is the supported way to prefix index names. The scope key in the connection string is only used for ElasticsearchToMigrate, so on the main cluster it does nothing and causes no harm.
Activity
ejsmith commentedon Nov 4, 2026
Closing.
AppScopeis the supported way to prefix index names. Thescopekey in the connection string is only used forElasticsearchToMigrate, so on the main cluster it does nothing and causes no harm.