File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/stats Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -95,20 +95,19 @@ private FieldConfig makeFieldConfig(String field) {
9595 // since if it's missing, deleted documents won't change that
9696 for (SearchExecutionContext context : contexts ) {
9797 if (context .isFieldMapped (field )) {
98- exists = exists || true ;
99- MappedFieldType type = context .getFieldType (field );
100- indexed = indexed && type .isIndexed ();
101- hasDocValues = hasDocValues && type .hasDocValues ();
102- if (type instanceof TextFieldMapper .TextFieldType t ) {
103- hasExactSubfield = hasExactSubfield && t .canUseSyntheticSourceDelegateForQuerying ();
104- } else {
105- hasExactSubfield = false ;
106- }
98+ var type = context .getFieldType (field );
99+ exists |= true ;
100+ indexed &= type .isIndexed ();
101+ hasDocValues &= type .hasDocValues ();
102+ hasExactSubfield &= type instanceof TextFieldMapper .TextFieldType t && t .canUseSyntheticSourceDelegateForQuerying ();
107103 } else {
108104 indexed = false ;
109105 hasDocValues = false ;
110106 hasExactSubfield = false ;
111107 }
108+ if (exists && indexed == false && hasDocValues == false && hasExactSubfield == false ) {
109+ break ;
110+ }
112111 }
113112 if (exists == false ) {
114113 // if it does not exist on any context, no other settings are valid
You can’t perform that action at this time.
0 commit comments