Skip to content

Commit 746a233

Browse files
committed
Introduce a new setting and a feature flag for the synthetic vectors mode in mappings
1 parent f88aaa3 commit 746a233

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

server/src/main/java/org/elasticsearch/common/settings/IndexScopedSettings.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
import java.util.Map;
5050
import java.util.Set;
5151

52+
import static org.elasticsearch.index.IndexSettings.SYNTHETIC_VECTORS;
53+
5254
/**
5355
* Encapsulates all valid index level settings.
5456
* @see Property#IndexScope
@@ -240,6 +242,9 @@ public final class IndexScopedSettings extends AbstractScopedSettings {
240242
if (IndexSettings.DOC_VALUES_SKIPPER) {
241243
settings.add(IndexSettings.USE_DOC_VALUES_SKIPPER);
242244
}
245+
if (SYNTHETIC_VECTORS) {
246+
settings.add(IndexSettings.INDEX_MAPPING_SOURCE_SYNTHETIC_VECTORS_SETTING);
247+
}
243248
BUILT_IN_INDEX_SETTINGS = Collections.unmodifiableSet(settings);
244249
};
245250

server/src/main/java/org/elasticsearch/index/IndexSettings.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,14 @@ private static String getIgnoreAboveDefaultValue(final Settings settings) {
847847
Property.Final
848848
);
849849

850+
public static final boolean SYNTHETIC_VECTORS = new FeatureFlag("mapping_synthetic_vectors").isEnabled();
851+
public static final Setting<Boolean> INDEX_MAPPING_SOURCE_SYNTHETIC_VECTORS_SETTING = Setting.boolSetting(
852+
"index.mapping.synthetic_vectors",
853+
false,
854+
Property.IndexScope,
855+
Property.Final
856+
);
857+
850858
private final Index index;
851859
private final IndexVersion version;
852860
private final Logger logger;
@@ -890,7 +898,7 @@ private static String getIgnoreAboveDefaultValue(final Settings settings) {
890898
private final boolean logsdbRouteOnSortFields;
891899
private final boolean logsdbSortOnHostName;
892900
private final boolean logsdbAddHostNameField;
893-
901+
private volatile boolean searchExcludeVectors;
894902
private volatile long retentionLeaseMillis;
895903

896904
/**

0 commit comments

Comments
 (0)