Skip to content

Commit

Permalink
Mark fuzzy filter GA and remove experimental setting (#12631)
Browse files Browse the repository at this point in the history
Signed-off-by: mgodwan <mgodwan@amazon.com>
  • Loading branch information
mgodwan committed Mar 19, 2024
1 parent e1403a2 commit 7e2de42
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 35 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Changed
- Allow composite aggregation to run under a parent filter aggregation ([#11499](https://github.com/opensearch-project/OpenSearch/pull/11499))
- Quickly compute terms aggregations when the top-level query is functionally match-all for a segment ([#11643](https://github.com/opensearch-project/OpenSearch/pull/11643))
- Mark fuzzy filter GA and remove experimental setting ([12631](https://github.com/opensearch-project/OpenSearch/pull/12631))

### Deprecated

Expand Down
1 change: 0 additions & 1 deletion qa/rolling-upgrade/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ for (Version bwcVersion : BuildParams.bwcVersions.wireCompatible) {
setting 'repositories.url.allowed_urls', 'http://snapshot.test*'
setting 'path.repo', "${buildDir}/cluster/shared/repo/${baseName}"
setting 'http.content_type.required', 'true'
systemProperty 'opensearch.experimental.optimize_doc_id_lookup.fuzzy_set.enabled', 'true'
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ protected FeatureFlagSettings(
FeatureFlags.TELEMETRY_SETTING,
FeatureFlags.DATETIME_FORMATTER_CACHING_SETTING,
FeatureFlags.WRITEABLE_REMOTE_INDEX_SETTING,
FeatureFlags.DOC_ID_FUZZY_SET_SETTING,
FeatureFlags.PLUGGABLE_CACHE_SETTING
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ public class FeatureFlags {
*/
public static final String WRITEABLE_REMOTE_INDEX = "opensearch.experimental.feature.writeable_remote_index.enabled";

/**
* Gates the optimization to enable bloom filters for doc id lookup.
*/
public static final String DOC_ID_FUZZY_SET = "opensearch.experimental.optimize_doc_id_lookup.fuzzy_set.enabled";

/**
* Gates the functionality of pluggable cache.
* Enables OpenSearch to use pluggable caches with respective store names via setting.
Expand Down Expand Up @@ -122,7 +117,5 @@ public static boolean isEnabled(Setting<Boolean> featureFlag) {
Property.NodeScope
);

public static final Setting<Boolean> DOC_ID_FUZZY_SET_SETTING = Setting.boolSetting(DOC_ID_FUZZY_SET, false, Property.NodeScope);

public static final Setting<Boolean> PLUGGABLE_CACHE_SETTING = Setting.boolSetting(PLUGGABLE_CACHE, false, Property.NodeScope);
}
28 changes: 4 additions & 24 deletions server/src/main/java/org/opensearch/index/IndexSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
import java.util.function.UnaryOperator;

import static org.opensearch.Version.V_2_7_0;
import static org.opensearch.common.util.FeatureFlags.DOC_ID_FUZZY_SET_SETTING;
import static org.opensearch.common.util.FeatureFlags.SEARCHABLE_SNAPSHOT_EXTENDED_COMPATIBILITY;
import static org.opensearch.index.codec.fuzzy.FuzzySetParameters.DEFAULT_FALSE_POSITIVE_PROBABILITY;
import static org.opensearch.index.mapper.MapperService.INDEX_MAPPING_DEPTH_LIMIT_SETTING;
Expand Down Expand Up @@ -968,11 +967,8 @@ public IndexSettings(final IndexMetadata indexMetadata, final Settings nodeSetti
*/
widenIndexSortType = IndexMetadata.SETTING_INDEX_VERSION_CREATED.get(settings).before(V_2_7_0);

boolean isOptimizeDocIdLookupUsingFuzzySetFeatureEnabled = FeatureFlags.isEnabled(DOC_ID_FUZZY_SET_SETTING);
if (isOptimizeDocIdLookupUsingFuzzySetFeatureEnabled) {
enableFuzzySetForDocId = scopedSettings.get(INDEX_DOC_ID_FUZZY_SET_ENABLED_SETTING);
docIdFuzzySetFalsePositiveProbability = scopedSettings.get(INDEX_DOC_ID_FUZZY_SET_FALSE_POSITIVE_PROBABILITY_SETTING);
}
setEnableFuzzySetForDocId(scopedSettings.get(INDEX_DOC_ID_FUZZY_SET_ENABLED_SETTING));
setDocIdFuzzySetFalsePositiveProbability(scopedSettings.get(INDEX_DOC_ID_FUZZY_SET_FALSE_POSITIVE_PROBABILITY_SETTING));

scopedSettings.addSettingsUpdateConsumer(
TieredMergePolicyProvider.INDEX_COMPOUND_FORMAT_SETTING,
Expand Down Expand Up @@ -1873,30 +1869,14 @@ public boolean isEnableFuzzySetForDocId() {
}

public void setEnableFuzzySetForDocId(boolean enableFuzzySetForDocId) {
verifyFeatureToSetDocIdFuzzySetSetting(enabled -> this.enableFuzzySetForDocId = enabled, enableFuzzySetForDocId);
this.enableFuzzySetForDocId = enableFuzzySetForDocId;
}

public double getDocIdFuzzySetFalsePositiveProbability() {
return docIdFuzzySetFalsePositiveProbability;
}

public void setDocIdFuzzySetFalsePositiveProbability(double docIdFuzzySetFalsePositiveProbability) {
verifyFeatureToSetDocIdFuzzySetSetting(
fpp -> this.docIdFuzzySetFalsePositiveProbability = fpp,
docIdFuzzySetFalsePositiveProbability
);
}

private static <T> void verifyFeatureToSetDocIdFuzzySetSetting(Consumer<T> settingUpdater, T val) {
if (FeatureFlags.isEnabled(DOC_ID_FUZZY_SET_SETTING)) {
settingUpdater.accept(val);
} else {
throw new IllegalArgumentException(
"Fuzzy set for optimizing doc id lookup "
+ "cannot be enabled with feature flag ["
+ FeatureFlags.DOC_ID_FUZZY_SET
+ "] set to false"
);
}
this.docIdFuzzySetFalsePositiveProbability = docIdFuzzySetFalsePositiveProbability;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -676,8 +676,6 @@ protected Settings featureFlagSettings() {
// Enabling Telemetry setting by default
featureSettings.put(FeatureFlags.TELEMETRY_SETTING.getKey(), true);

// Enabling fuzzy set for tests by default
featureSettings.put(FeatureFlags.DOC_ID_FUZZY_SET_SETTING.getKey(), true);
return featureSettings.build();
}

Expand Down

0 comments on commit 7e2de42

Please sign in to comment.