diff --git a/deployment/helm/ditto/Chart.yaml b/deployment/helm/ditto/Chart.yaml index 0e73c5a1ae..b21a183a8d 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: 3.4.4 # chart version is effectively set by release-job +version: 3.4.5 # chart version is effectively set by release-job appVersion: 3.4.4 keywords: - iot-chart diff --git a/deployment/helm/ditto/templates/thingssearch-deployment.yaml b/deployment/helm/ditto/templates/thingssearch-deployment.yaml index aabaccdfc4..261b1256f9 100644 --- a/deployment/helm/ditto/templates/thingssearch-deployment.yaml +++ b/deployment/helm/ditto/templates/thingssearch-deployment.yaml @@ -136,6 +136,15 @@ spec: {{- if .Values.global.logging.customConfigFile.enabled }} -Dlogback.configurationFile=/opt/ditto/{{ .Values.global.logging.customConfigFile.fileName }} {{- end }} + {{- if .Values.thingsSearch.config.indexedFieldsLimiting.enabled }} + -Dditto.extensions.caching-signal-enrichment-facade-provider=org.eclipse.ditto.thingsearch.service.persistence.write.streaming.SearchIndexingSignalEnrichmentFacadeProvider + {{- range $index, $value := .Values.thingsSearch.config.indexedFieldsLimiting.items }} + "{{ printf "%s%d%s=%s" "-Dditto.search.namespace-indexed-fields." $index ".namespace-pattern" $value.namespacePattern }}" + {{- range $fieldIndex, $indexedField := $value.indexedFields }} + "{{ printf "%s%d%s%d=%s" "-Dditto.search.namespace-indexed-fields." $index ".indexed-fields." $fieldIndex $indexedField }}" + {{- end }} + {{- end }} + {{- end }} {{- range $key, $value := .Values.thingsSearch.config.operatorMetrics.customMetrics }} "{{ printf "%s%s%s=%t" "-Dditto.search.operator-metrics.custom-metrics." $key ".enabled" $value.enabled }}" "{{ printf "%s%s%s=%s" "-Dditto.search.operator-metrics.custom-metrics." $key ".scrape-interval" $value.scrapeInterval }}" diff --git a/deployment/helm/ditto/values.yaml b/deployment/helm/ditto/values.yaml index 483601d1fe..e1cfdc2763 100644 --- a/deployment/helm/ditto/values.yaml +++ b/deployment/helm/ditto/values.yaml @@ -1077,6 +1077,20 @@ thingsSearch: throughput: 100 # period the throttle period period: 30s + # indexedFieldsLimiting by default, Ditto indexed all fields of things in its search. + # However, this behavior can be customized, providing configuration to only index certain fields for specified namespaces. + indexedFieldsLimiting: + # enabled whether field index limiting should be enabled or not + enabled: false + # items contains the list of per-namespace configuration of which fields to include into to the search index + items: + # - # namespacePattern holds the namespace for which the single limiting configuration entry should apply. + # # Wildcards `*` (Matching any number of any character) and `?` (Matches any single character) are supported. + # namespacePattern: "org.eclipse.*" + # # indexedFields holds a list of fields that will be explicitly included in the search index + # indexedFields: + # - "attributes" + # - "features/included" # operatorMetrics contains configuration for operator defined custom metrics, using a search "count" with namespaces and filter operatorMetrics: # enabled configures whether operator metrics should be enabled or not diff --git a/documentation/src/main/resources/pages/ditto/installation-operating.md b/documentation/src/main/resources/pages/ditto/installation-operating.md index c9f352b19d..e6fe7f6120 100644 --- a/documentation/src/main/resources/pages/ditto/installation-operating.md +++ b/documentation/src/main/resources/pages/ditto/installation-operating.md @@ -340,10 +340,10 @@ ditto { caching-signal-enrichment-facade-provider = org.eclipse.ditto.thingsearch.service.persistence.write.streaming.SearchIndexingSignalEnrichmentFacadeProvider //... search { - namespace-search-include-fields = [ + namespace-indexed-fields = [ { namespace-pattern = "org.eclipse.test" - search-include-fields = [ + indexed-fields = [ "attributes", "features/info/properties", "features/info/other" @@ -351,7 +351,7 @@ ditto { }, { namespace-pattern = "org.eclipse*" - search-include-fields = [ + indexed-fields = [ "attributes", "features/info" ] @@ -378,13 +378,13 @@ Important notes: Example for configuring the same configuration via system properties for the `things-search` service: ```shell --Dditto.search.namespace-search-include-fields.0.namespace-pattern=org.eclipse.test --Dditto.search.namespace-search-include-fields.0.search-include-fields.0=attributes --Dditto.search.namespace-search-include-fields.0.search-include-fields.1=features/info/properties --Dditto.search.namespace-search-include-fields.0.search-include-fields.2=features/info/other --Dditto.search.namespace-search-include-fields.1.namespace-pattern=org.eclipse* --Dditto.search.namespace-search-include-fields.1.search-include-fields.0=attributes --Dditto.search.namespace-search-include-fields.1.search-include-fields.1=features/info +-Dditto.search.namespace-indexed-fields.0.namespace-pattern=org.eclipse.test +-Dditto.search.namespace-indexed-fields.0.indexed-fields.0=attributes +-Dditto.search.namespace-indexed-fields.0.indexed-fields.1=features/info/properties +-Dditto.search.namespace-indexed-fields.0.indexed-fields.2=features/info/other +-Dditto.search.namespace-indexed-fields.1.namespace-pattern=org.eclipse* +-Dditto.search.namespace-indexed-fields.1.indexed-fields.0=attributes +-Dditto.search.namespace-indexed-fields.1.indexed-fields.1=features/info ``` ## Logging diff --git a/thingsearch/service/src/main/java/org/eclipse/ditto/thingsearch/service/common/config/DefaultNamespaceSearchIndexConfig.java b/thingsearch/service/src/main/java/org/eclipse/ditto/thingsearch/service/common/config/DefaultNamespaceSearchIndexConfig.java index b8cf1859bc..37163575dd 100644 --- a/thingsearch/service/src/main/java/org/eclipse/ditto/thingsearch/service/common/config/DefaultNamespaceSearchIndexConfig.java +++ b/thingsearch/service/src/main/java/org/eclipse/ditto/thingsearch/service/common/config/DefaultNamespaceSearchIndexConfig.java @@ -12,9 +12,6 @@ */ package org.eclipse.ditto.thingsearch.service.common.config; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; import java.util.List; import java.util.Objects; @@ -30,25 +27,22 @@ public final class DefaultNamespaceSearchIndexConfig implements NamespaceSearchI private final String namespacePattern; - private final List searchIncludeFields; + private final List includedFields; private DefaultNamespaceSearchIndexConfig(final ConfigWithFallback configWithFallback) { - this.namespacePattern = configWithFallback.getString(NamespaceSearchIndexConfigValue.NAMESPACE_PATTERN.getConfigPath()); + this.namespacePattern = + configWithFallback.getString(NamespaceSearchIndexConfigValue.NAMESPACE_PATTERN.getConfigPath()); - final List fields = configWithFallback.getStringList(NamespaceSearchIndexConfigValue.SEARCH_INCLUDE_FIELDS.getConfigPath()); + final List fields = + configWithFallback.getStringList(NamespaceSearchIndexConfigValue.INDEXED_FIELDS.getConfigPath()); if (!fields.isEmpty()) { - this.searchIncludeFields = Collections.unmodifiableList(new ArrayList<>(fields)); + this.includedFields = List.copyOf(fields); } else { - this.searchIncludeFields = List.of(); + this.includedFields = List.of(); } } - private DefaultNamespaceSearchIndexConfig(final String namespacePattern, final Collection fields) { - this.namespacePattern = namespacePattern; - this.searchIncludeFields = Collections.unmodifiableList(new ArrayList<>(fields)); - } - /** * Returns an instance of {@code DefaultNamespaceSearchIndexConfig} based on the settings of the specified Config. * @@ -66,8 +60,8 @@ public String getNamespacePattern() { } @Override - public List getSearchIncludeFields() { - return searchIncludeFields; + public List getIndexedFields() { + return includedFields; } @Override @@ -79,19 +73,20 @@ public boolean equals(final Object o) { return false; } final DefaultNamespaceSearchIndexConfig that = (DefaultNamespaceSearchIndexConfig) o; - return Objects.equals(namespacePattern, that.namespacePattern) && searchIncludeFields.equals(that.searchIncludeFields); + return Objects.equals(namespacePattern, that.namespacePattern) && + includedFields.equals(that.includedFields); } @Override public int hashCode() { - return Objects.hash(namespacePattern, searchIncludeFields); + return Objects.hash(namespacePattern, includedFields); } @Override public String toString() { return getClass().getSimpleName() + " [" + - "namespace=" + namespacePattern + - ", searchIncludeFields=" + searchIncludeFields + + "namespacePattern=" + namespacePattern + + ", searchIncludeFields=" + includedFields + "]"; } } \ No newline at end of file diff --git a/thingsearch/service/src/main/java/org/eclipse/ditto/thingsearch/service/common/config/DittoSearchConfig.java b/thingsearch/service/src/main/java/org/eclipse/ditto/thingsearch/service/common/config/DittoSearchConfig.java index 18a0e28a49..05408f824d 100644 --- a/thingsearch/service/src/main/java/org/eclipse/ditto/thingsearch/service/common/config/DittoSearchConfig.java +++ b/thingsearch/service/src/main/java/org/eclipse/ditto/thingsearch/service/common/config/DittoSearchConfig.java @@ -12,8 +12,13 @@ */ package org.eclipse.ditto.thingsearch.service.common.config; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Objects; import java.util.Optional; +import java.util.Set; import java.util.function.BiConsumer; import java.util.function.BinaryOperator; import java.util.function.Function; @@ -25,13 +30,11 @@ import javax.annotation.Nullable; import javax.annotation.concurrent.Immutable; -import com.typesafe.config.*; import org.eclipse.ditto.base.service.config.DittoServiceConfig; import org.eclipse.ditto.base.service.config.http.HttpConfig; import org.eclipse.ditto.base.service.config.limits.LimitsConfig; import org.eclipse.ditto.internal.utils.cluster.config.ClusterConfig; import org.eclipse.ditto.internal.utils.config.ConfigWithFallback; -import org.eclipse.ditto.internal.utils.config.KnownConfigValue; import org.eclipse.ditto.internal.utils.config.ScopedConfig; import org.eclipse.ditto.internal.utils.config.WithConfigPath; import org.eclipse.ditto.internal.utils.health.config.DefaultHealthCheckConfig; @@ -45,6 +48,11 @@ import org.eclipse.ditto.internal.utils.persistence.operations.PersistenceOperationsConfig; import org.eclipse.ditto.internal.utils.tracing.config.TracingConfig; +import com.typesafe.config.Config; +import com.typesafe.config.ConfigFactory; +import com.typesafe.config.ConfigList; +import com.typesafe.config.ConfigValue; + /** * This class is the default implementation of {@link SearchConfig}. @@ -65,8 +73,8 @@ public final class DittoSearchConfig implements SearchConfig, WithConfigPath { private final MongoDbConfig mongoDbConfig; private final SearchPersistenceConfig queryPersistenceConfig; private final Map simpleFieldMappings; + private final List namespaceIndexedFields; private final DefaultOperatorMetricsConfig operatorMetricsConfig; - private final List namespaceSearchIncludeFields; private DittoSearchConfig(final ScopedConfig dittoScopedConfig) { dittoServiceConfig = DittoServiceConfig.of(dittoScopedConfig, CONFIG_PATH); @@ -86,8 +94,8 @@ private DittoSearchConfig(final ScopedConfig dittoScopedConfig) { queryPersistenceConfig = DefaultSearchPersistenceConfig.of(queryConfig); simpleFieldMappings = convertToMap(configWithFallback.getConfig(SearchConfigValue.SIMPLE_FIELD_MAPPINGS.getConfigPath())); + namespaceIndexedFields = loadNamespaceSearchIndexList(configWithFallback); operatorMetricsConfig = DefaultOperatorMetricsConfig.of(configWithFallback); - namespaceSearchIncludeFields = loadNamespaceSearchIndexList(configWithFallback); } /** @@ -108,8 +116,8 @@ public Optional getMongoHintsByNamespace() { } @Override - public List getNamespaceSearchIncludeFields() { - return namespaceSearchIncludeFields; + public List getNamespaceIndexedFields() { + return namespaceIndexedFields; } @Override @@ -196,14 +204,14 @@ public boolean equals(final Object o) { Objects.equals(queryPersistenceConfig, that.queryPersistenceConfig) && Objects.equals(simpleFieldMappings, that.simpleFieldMappings) && Objects.equals(operatorMetricsConfig, that.operatorMetricsConfig) && - Objects.equals(namespaceSearchIncludeFields, that.namespaceSearchIncludeFields); + Objects.equals(namespaceIndexedFields, that.namespaceIndexedFields); } @Override public int hashCode() { return Objects.hash(mongoHintsByNamespace, updaterConfig, dittoServiceConfig, healthCheckConfig, indexInitializationConfig, persistenceOperationsConfig, mongoDbConfig, queryPersistenceConfig, - simpleFieldMappings, operatorMetricsConfig, namespaceSearchIncludeFields); + simpleFieldMappings, operatorMetricsConfig, namespaceIndexedFields); } @Override @@ -218,8 +226,8 @@ public String toString() { ", mongoDbConfig=" + mongoDbConfig + ", queryPersistenceConfig=" + queryPersistenceConfig + ", simpleFieldMappings=" + simpleFieldMappings + + ", namespaceIndexedFields=" + namespaceIndexedFields + ", operatorMetricsConfig=" + operatorMetricsConfig + - ", namespaceSearchIncludeFields=" + namespaceSearchIncludeFields + "]"; } @@ -239,10 +247,10 @@ private static Map convertToMap(final Config config) { private static List loadNamespaceSearchIndexList(final ConfigWithFallback config) { - final ConfigList namespaceSearchIndexConfig = config.getList( - SearchConfigValue.NAMESPACE_SEARCH_INCLUDE_FIELDS.getConfigPath()); + final ConfigList namespaceIndexedFieldsConfig = config.getList( + SearchConfigValue.NAMESPACE_INDEXED_FIELDS.getConfigPath()); - return namespaceSearchIndexConfig.stream().collect(NamespaceSearchIndexCollector.toNamespaceSearchIndexList()); + return namespaceIndexedFieldsConfig.stream().collect(NamespaceSearchIndexCollector.toNamespaceSearchIndexList()); } private static class NamespaceSearchIndexCollector implements @@ -266,12 +274,12 @@ public BiConsumer, ConfigValue> accumulator() { @Override public BinaryOperator> combiner() { return (left, right) -> Stream.concat(left.stream(), right.stream()) - .collect(Collectors.toList()); + .toList(); } @Override public Function, List> finisher() { - return list -> Collections.unmodifiableList(new ArrayList<>(list)); + return List::copyOf; } @Override diff --git a/thingsearch/service/src/main/java/org/eclipse/ditto/thingsearch/service/common/config/NamespaceSearchIndexConfig.java b/thingsearch/service/src/main/java/org/eclipse/ditto/thingsearch/service/common/config/NamespaceSearchIndexConfig.java index 2a37941a50..f5dc7b037e 100644 --- a/thingsearch/service/src/main/java/org/eclipse/ditto/thingsearch/service/common/config/NamespaceSearchIndexConfig.java +++ b/thingsearch/service/src/main/java/org/eclipse/ditto/thingsearch/service/common/config/NamespaceSearchIndexConfig.java @@ -12,10 +12,11 @@ */ package org.eclipse.ditto.thingsearch.service.common.config; -import org.eclipse.ditto.internal.utils.config.KnownConfigValue; +import java.util.List; import javax.annotation.concurrent.Immutable; -import java.util.List; + +import org.eclipse.ditto.internal.utils.config.KnownConfigValue; /** * Provides configuration settings of the namespace-scoped search indexes. @@ -34,21 +35,21 @@ public interface NamespaceSearchIndexConfig { /** * Returns a list of fields that will be explicitly included in the search index. * - * @return the search projection fields. + * @return the indexed fields. */ - List getSearchIncludeFields(); + List getIndexedFields(); enum NamespaceSearchIndexConfigValue implements KnownConfigValue { /** - * The namespace value to apply the search indexed fields. + * The namespace pattern to apply the search indexed fields. */ NAMESPACE_PATTERN("namespace-pattern", ""), /** * The list of fields that will be included in the search DB. */ - SEARCH_INCLUDE_FIELDS("search-include-fields", List.of()); + INDEXED_FIELDS("indexed-fields", List.of()); private final String configPath; private final Object defaultValue; diff --git a/thingsearch/service/src/main/java/org/eclipse/ditto/thingsearch/service/common/config/SearchConfig.java b/thingsearch/service/src/main/java/org/eclipse/ditto/thingsearch/service/common/config/SearchConfig.java index 9842342654..a734915262 100644 --- a/thingsearch/service/src/main/java/org/eclipse/ditto/thingsearch/service/common/config/SearchConfig.java +++ b/thingsearch/service/src/main/java/org/eclipse/ditto/thingsearch/service/common/config/SearchConfig.java @@ -72,7 +72,7 @@ public interface SearchConfig extends ServiceSpecificConfig, WithHealthCheckConf * @return the search projection fields. * @since 3.5.0 */ - List getNamespaceSearchIncludeFields(); + List getNamespaceIndexedFields(); /** * An enumeration of the known config path expressions and their associated default values for SearchConfig. @@ -104,8 +104,10 @@ enum SearchConfigValue implements KnownConfigValue { /** * Any fields to include in the search index, scoped by namespace. + * + * @since 3.5.0 */ - NAMESPACE_SEARCH_INCLUDE_FIELDS("namespace-search-include-fields", Collections.emptyList()); + NAMESPACE_INDEXED_FIELDS("namespace-indexed-fields", Collections.emptyList()); private final String path; private final Object defaultValue; diff --git a/thingsearch/service/src/main/java/org/eclipse/ditto/thingsearch/service/persistence/write/streaming/SearchIndexingSignalEnrichmentFacadeProvider.java b/thingsearch/service/src/main/java/org/eclipse/ditto/thingsearch/service/persistence/write/streaming/SearchIndexingSignalEnrichmentFacadeProvider.java index 9c880008eb..2c22c0d1c7 100644 --- a/thingsearch/service/src/main/java/org/eclipse/ditto/thingsearch/service/persistence/write/streaming/SearchIndexingSignalEnrichmentFacadeProvider.java +++ b/thingsearch/service/src/main/java/org/eclipse/ditto/thingsearch/service/persistence/write/streaming/SearchIndexingSignalEnrichmentFacadeProvider.java @@ -45,7 +45,7 @@ */ public final class SearchIndexingSignalEnrichmentFacadeProvider implements CachingSignalEnrichmentFacadeProvider { - private static final Set> REQUIRED_INDEXED_FIELDS = Set.of( + private static final List> REQUIRED_INDEXED_FIELDS = List.of( Thing.JsonFields.ID, Thing.JsonFields.POLICY_ID, Thing.JsonFields.NAMESPACE, @@ -76,9 +76,9 @@ public CachingSignalEnrichmentFacade getSignalEnrichmentFacade( // Build a map of field selectors for the enrichment facade to use to quickly look up by Thing namespace. final List> namespaceAndFieldSelector = new ArrayList<>(); - for (final NamespaceSearchIndexConfig namespaceConfig : searchConfig.getNamespaceSearchIncludeFields()) { + for (final NamespaceSearchIndexConfig namespaceConfig : searchConfig.getNamespaceIndexedFields()) { - if (!namespaceConfig.getSearchIncludeFields().isEmpty()) { + if (!namespaceConfig.getIndexedFields().isEmpty()) { // Ensure the constructed JsonFieldSelector has the required fields needed for the search to work. final Set set = new LinkedHashSet<>(); @@ -86,7 +86,7 @@ public CachingSignalEnrichmentFacade getSignalEnrichmentFacade( .map(JsonFieldDefinition::getPointer) .map(JsonPointer::toString) .toList()); - set.addAll(namespaceConfig.getSearchIncludeFields()); + set.addAll(namespaceConfig.getIndexedFields()); final List searchIncludeFields = new ArrayList<>(set); diff --git a/thingsearch/service/src/main/resources/search.conf b/thingsearch/service/src/main/resources/search.conf index 0b3b67a41b..abb527f3dc 100755 --- a/thingsearch/service/src/main/resources/search.conf +++ b/thingsearch/service/src/main/resources/search.conf @@ -69,12 +69,12 @@ ditto { # This configuration is used in conjunction with the new caching-signal-enrichment-facade-provider implementation # to only index a selected array of JSON pointers scoped by namespace. - namespace-search-include-fields = [ + namespace-indexed-fields = [ # Example: For the namespace-pattern "org.eclipse", only the "attributes" and "features/info" will be indexed in the # search database. # { # namespace-pattern = "org.eclipse", - # search-include-fields = [ "attributes", "features/info" ] + # indexed-fields = [ "attributes", "features/info" ] # } ] diff --git a/thingsearch/service/src/test/java/org/eclipse/ditto/thingsearch/service/common/config/DefaultNamespaceSearchIndexConfigTest.java b/thingsearch/service/src/test/java/org/eclipse/ditto/thingsearch/service/common/config/DefaultNamespaceSearchIndexConfigTest.java index 89b771ed17..d844d58e7e 100644 --- a/thingsearch/service/src/test/java/org/eclipse/ditto/thingsearch/service/common/config/DefaultNamespaceSearchIndexConfigTest.java +++ b/thingsearch/service/src/test/java/org/eclipse/ditto/thingsearch/service/common/config/DefaultNamespaceSearchIndexConfigTest.java @@ -40,7 +40,7 @@ public void assertImmutability() { assertInstancesOf(DefaultNamespaceSearchIndexConfig.class, areImmutable(), provided(String.class).isAlsoImmutable(), assumingFields( - "search-include-fields").areSafelyCopiedUnmodifiableCollectionsWithImmutableElements() + "includedFields").areSafelyCopiedUnmodifiableCollectionsWithImmutableElements() ); } @@ -58,9 +58,9 @@ public void underTestReturnsDefaultValuesIfBaseConfigWasEmpty() { final DittoSearchConfig underTest = DittoSearchConfig.of(DefaultScopedConfig.dittoScoped(searchConfig)); - softly.assertThat(underTest.getNamespaceSearchIncludeFields()).isNotNull(); + softly.assertThat(underTest.getNamespaceIndexedFields()).isNotNull(); - softly.assertThat(underTest.getNamespaceSearchIncludeFields()).isEmpty(); + softly.assertThat(underTest.getNamespaceIndexedFields()).isEmpty(); } @Test @@ -69,28 +69,28 @@ public void underTestReturnsValuesOfConfigFile() { final Config searchConfig = ConfigFactory.load("namespace-search-index-test"); final DittoSearchConfig underTest = DittoSearchConfig.of(DefaultScopedConfig.dittoScoped(searchConfig)); - softly.assertThat(underTest.getNamespaceSearchIncludeFields()).isNotNull(); + softly.assertThat(underTest.getNamespaceIndexedFields()).isNotNull(); - softly.assertThat(underTest.getNamespaceSearchIncludeFields()).isNotEmpty(); + softly.assertThat(underTest.getNamespaceIndexedFields()).isNotEmpty(); - softly.assertThat(underTest.getNamespaceSearchIncludeFields().size()).isEqualTo(2); + softly.assertThat(underTest.getNamespaceIndexedFields().size()).isEqualTo(2); - NamespaceSearchIndexConfig first = underTest.getNamespaceSearchIncludeFields().get(0); - NamespaceSearchIndexConfig second = underTest.getNamespaceSearchIncludeFields().get(1); + NamespaceSearchIndexConfig first = underTest.getNamespaceIndexedFields().get(0); + NamespaceSearchIndexConfig second = underTest.getNamespaceIndexedFields().get(1); // First config softly.assertThat(first.getNamespacePattern()).isEqualTo("org.eclipse.test"); - softly.assertThat(first.getSearchIncludeFields()) - .as(NamespaceSearchIndexConfig.NamespaceSearchIndexConfigValue.SEARCH_INCLUDE_FIELDS.getConfigPath()) + softly.assertThat(first.getIndexedFields()) + .as(NamespaceSearchIndexConfig.NamespaceSearchIndexConfigValue.INDEXED_FIELDS.getConfigPath()) .isEqualTo( List.of("attributes", "features/info/properties", "features/info/other")); // Second config softly.assertThat(second.getNamespacePattern()).isEqualTo("org.eclipse*"); - softly.assertThat(second.getSearchIncludeFields()) - .as(NamespaceSearchIndexConfig.NamespaceSearchIndexConfigValue.SEARCH_INCLUDE_FIELDS.getConfigPath()) + softly.assertThat(second.getIndexedFields()) + .as(NamespaceSearchIndexConfig.NamespaceSearchIndexConfigValue.INDEXED_FIELDS.getConfigPath()) .isEqualTo( List.of("attributes", "features/info")); } diff --git a/thingsearch/service/src/test/java/org/eclipse/ditto/thingsearch/service/starter/config/DittoSearchConfigTest.java b/thingsearch/service/src/test/java/org/eclipse/ditto/thingsearch/service/starter/config/DittoSearchConfigTest.java index 9a400eb9ee..2b55a526e2 100644 --- a/thingsearch/service/src/test/java/org/eclipse/ditto/thingsearch/service/starter/config/DittoSearchConfigTest.java +++ b/thingsearch/service/src/test/java/org/eclipse/ditto/thingsearch/service/starter/config/DittoSearchConfigTest.java @@ -47,7 +47,7 @@ public void assertImmutability() { DefaultMongoDbConfig.class, DefaultSearchPersistenceConfig.class, DefaultOperatorMetricsConfig.class) .areAlsoImmutable(), - assumingFields("simpleFieldMappings", "namespaceSearchIncludeFields") + assumingFields("simpleFieldMappings", "namespaceIndexedFields") .areSafelyCopiedUnmodifiableCollectionsWithImmutableElements()); } diff --git a/thingsearch/service/src/test/resources/namespace-search-index-test.conf b/thingsearch/service/src/test/resources/namespace-search-index-test.conf index 487545146a..6af53203ef 100644 --- a/thingsearch/service/src/test/resources/namespace-search-index-test.conf +++ b/thingsearch/service/src/test/resources/namespace-search-index-test.conf @@ -8,11 +8,11 @@ ditto { } } search { - namespace-search-include-fields = [ + namespace-indexed-fields = [ # The list of thing paths that are included in the search index. { namespace-pattern = "org.eclipse.test" - search-include-fields = [ + indexed-fields = [ "attributes", "features/info/properties", "features/info/other" @@ -20,7 +20,7 @@ ditto { }, { namespace-pattern = "org.eclipse*" - search-include-fields = [ + indexed-fields = [ "attributes", "features/info" ]