From bfb5ab847975691b088ffecb209aaf6553ed2bf5 Mon Sep 17 00:00:00 2001 From: Piotr Grabowski Date: Wed, 6 Nov 2024 13:39:32 +0100 Subject: [PATCH] Disallow `schemaOverrides` in `*` configuration (#953) Disallow `schemaOverrides` in configuration of `*` index, since that functionality does not work correctly right now. Note that in the future we might lift this restriction (if we fix the implementation). Documentation of this limitation will be included in #950. --- quesma/quesma/config/config_v2.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/quesma/quesma/config/config_v2.go b/quesma/quesma/config/config_v2.go index b919153c9..a3f2cf550 100644 --- a/quesma/quesma/config/config_v2.go +++ b/quesma/quesma/config/config_v2.go @@ -574,6 +574,9 @@ func (c *QuesmaNewConfiguration) TranslateToLegacyConfig() QuesmaConfiguration { conf.CreateCommonTable = true conf.UseCommonTableForWildcard = true } + if defaultConfig.SchemaOverrides != nil { + errAcc = multierror.Append(errAcc, fmt.Errorf("schema overrides of default index ('%s') are not currently supported (only supported in configuration of a specific index)", DefaultWildcardIndexName)) + } if len(defaultConfig.QueryTarget) > 1 { errAcc = multierror.Append(errAcc, fmt.Errorf("the target configuration of default index ('%s') of query processor is not currently supported", DefaultWildcardIndexName)) } @@ -659,6 +662,9 @@ func (c *QuesmaNewConfiguration) TranslateToLegacyConfig() QuesmaConfiguration { conf.UseCommonTableForWildcard = val == "true" } } + if defaultConfig.SchemaOverrides != nil { + errAcc = multierror.Append(errAcc, fmt.Errorf("schema overrides of default index ('%s') are not currently supported (only supported in configuration of a specific index)", DefaultWildcardIndexName)) + } if defaultConfig.UseCommonTable { // We set both flags to true here // as creating common table depends on the first one @@ -682,6 +688,9 @@ func (c *QuesmaNewConfiguration) TranslateToLegacyConfig() QuesmaConfiguration { conf.UseCommonTableForWildcard = val == "true" } } + if ingestProcessorDefaultIndexConfig.SchemaOverrides != nil { + errAcc = multierror.Append(errAcc, fmt.Errorf("schema overrides of default index ('%s') are not currently supported (only supported in configuration of a specific index)", DefaultWildcardIndexName)) + } if ingestProcessorDefaultIndexConfig.UseCommonTable { // We set both flags to true here // as creating common table depends on the first one