diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java index 8a1a7f1cad334..fc0e0702f3f2a 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java @@ -19,6 +19,8 @@ import java.util.Locale; import java.util.Set; +import static org.elasticsearch.index.mapper.FieldMapper.DocValuesParameter.EXTENDED_DOC_VALUES_PARAMS_FF; + /** * A {@link Set} of "capabilities" supported by the {@link RestEsqlQueryAction} * and {@link RestEsqlAsyncQueryAction} APIs. These are exposed over the @@ -810,6 +812,11 @@ public enum Cap { */ SOURCE_FIELD_MAPPING, + /** + * Support for extended doc values params. + */ + EXTENDED_DOC_VALUES_PARAMS(EXTENDED_DOC_VALUES_PARAMS_FF.isEnabled()), + /** * Allow filter per individual aggregation. */ diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/querydsl/query/SingleValueMatchQueryTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/querydsl/query/SingleValueMatchQueryTests.java index 3404143acfdb4..6ac2475dd400a 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/querydsl/query/SingleValueMatchQueryTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/querydsl/query/SingleValueMatchQueryTests.java @@ -41,6 +41,7 @@ import java.util.List; import java.util.Set; +import static org.elasticsearch.index.mapper.FieldMapper.DocValuesParameter.EXTENDED_DOC_VALUES_PARAMS_FF; import static org.elasticsearch.index.mapper.MultiValuedBinaryDocValuesField.SeparateCount.COUNT_FIELD_SUFFIX; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; @@ -65,7 +66,7 @@ public static List params() { for (DocValuesMode docValuesMode : new DocValuesMode[] { DocValuesMode.DEFAULT, DocValuesMode.DOC_VALUES_ONLY }) { params.add(new Object[] { new StandardSetup(fieldType, multivaluedField, docValuesMode, allowEmpty, 100) }); } - if (fieldType.equals("keyword")) { + if (fieldType.equals("keyword") && EXTENDED_DOC_VALUES_PARAMS_FF.isEnabled()) { params.add( new Object[] { new StandardSetup( diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/250_high_cardinality_keyword.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/250_high_cardinality_keyword.yml index 1eadab3e44d41..78961db5de223 100644 --- a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/250_high_cardinality_keyword.yml +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/250_high_cardinality_keyword.yml @@ -1,7 +1,12 @@ --- setup: - requires: - cluster_features: ["mapper.keyword.high_cardinality_length_function_fuse_to_load"] + test_runner_features: [ capabilities ] + capabilities: + - method: POST + path: /_query + parameters: [ ] + capabilities: [ extended_doc_values_params ] reason: "testing binary doc values search" - do: