|
@@ -98,6 +98,13 @@ public final class IndexSettings {
|
|
|
*/
|
|
|
public static final Setting<Integer> MAX_INNER_RESULT_WINDOW_SETTING =
|
|
|
Setting.intSetting("index.max_inner_result_window", 100, 1, Property.Dynamic, Property.IndexScope);
|
|
|
+ /**
|
|
|
+ * Index setting describing the maximum value of allowed `docvalue_fields`that can be retrieved
|
|
|
+ * per search request. The default maximum of 100 is defensive for the reason that retrieving
|
|
|
+ * doc values might incur a per-field per-document seek.
|
|
|
+ */
|
|
|
+ public static final Setting<Integer> MAX_DOCVALUE_FIELDS_SEARCH_SETTING =
|
|
|
+ Setting.intSetting("index.max_docvalue_fields_search", 100, 0, Property.Dynamic, Property.IndexScope);
|
|
|
/**
|
|
|
* Index setting describing the maximum size of the rescore window. Defaults to {@link #MAX_RESULT_WINDOW_SETTING}
|
|
|
* because they both do the same thing: control the size of the heap of hits.
|
|
@@ -221,6 +228,7 @@ public final class IndexSettings {
|
|
|
private volatile int maxInnerResultWindow;
|
|
|
private volatile int maxAdjacencyMatrixFilters;
|
|
|
private volatile int maxRescoreWindow;
|
|
|
+ private volatile int maxDocvalueFields;
|
|
|
private volatile boolean TTLPurgeDisabled;
|
|
|
/**
|
|
|
* The maximum number of refresh listeners allows on this shard.
|
|
@@ -322,6 +330,7 @@ public final class IndexSettings {
|
|
|
maxInnerResultWindow = scopedSettings.get(MAX_INNER_RESULT_WINDOW_SETTING);
|
|
|
maxAdjacencyMatrixFilters = scopedSettings.get(MAX_ADJACENCY_MATRIX_FILTERS_SETTING);
|
|
|
maxRescoreWindow = scopedSettings.get(MAX_RESCORE_WINDOW_SETTING);
|
|
|
+ maxDocvalueFields = scopedSettings.get(MAX_DOCVALUE_FIELDS_SEARCH_SETTING);
|
|
|
TTLPurgeDisabled = scopedSettings.get(INDEX_TTL_DISABLE_PURGE_SETTING);
|
|
|
maxRefreshListeners = scopedSettings.get(MAX_REFRESH_LISTENERS_PER_SHARD);
|
|
|
maxSlicesPerScroll = scopedSettings.get(MAX_SLICES_PER_SCROLL);
|
|
@@ -351,6 +360,7 @@ public final class IndexSettings {
|
|
|
scopedSettings.addSettingsUpdateConsumer(MAX_INNER_RESULT_WINDOW_SETTING, this::setMaxInnerResultWindow);
|
|
|
scopedSettings.addSettingsUpdateConsumer(MAX_ADJACENCY_MATRIX_FILTERS_SETTING, this::setMaxAdjacencyMatrixFilters);
|
|
|
scopedSettings.addSettingsUpdateConsumer(MAX_RESCORE_WINDOW_SETTING, this::setMaxRescoreWindow);
|
|
|
+ scopedSettings.addSettingsUpdateConsumer(MAX_DOCVALUE_FIELDS_SEARCH_SETTING, this::setMaxDocvalueFields);
|
|
|
scopedSettings.addSettingsUpdateConsumer(INDEX_WARMER_ENABLED_SETTING, this::setEnableWarmer);
|
|
|
scopedSettings.addSettingsUpdateConsumer(INDEX_GC_DELETES_SETTING, this::setGCDeletes);
|
|
|
scopedSettings.addSettingsUpdateConsumer(INDEX_TRANSLOG_FLUSH_THRESHOLD_SIZE_SETTING, this::setTranslogFlushThresholdSize);
|
|
@@ -607,6 +617,17 @@ public final class IndexSettings {
|
|
|
this.maxRescoreWindow = maxRescoreWindow;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Returns the maximum number of allowed docvalue_fields to retrieve in a search request
|
|
|
+ */
|
|
|
+ public int getMaxDocvalueFields() {
|
|
|
+ return this.maxDocvalueFields;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void setMaxDocvalueFields(int maxDocvalueFields) {
|
|
|
+ this.maxDocvalueFields = maxDocvalueFields;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Returns the GC deletes cycle in milliseconds.
|
|
|
*/
|