Skip to content

Commit 70f7390

Browse files
committed
Allow runtime fields to depend on one another
This updates a test so that runtime fields depend on one another and fixes support for it.
1 parent 719ef1f commit 70f7390

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

server/src/main/java/org/elasticsearch/index/query/QueryShardContext.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,7 @@ MappedFieldType failIfFieldMappingNotFound(String name, MappedFieldType fieldMap
297297

298298
public SearchLookup lookup() {
299299
if (lookup == null) {
300-
lookup = new SearchLookup(getMapperService(),
301-
mappedFieldType -> indexFieldDataService.apply(mappedFieldType, fullyQualifiedIndex.getName()));
300+
lookup = new SearchLookup(getMapperService(), this::getForField);
302301
}
303302
return lookup;
304303
}

x-pack/plugin/src/test/resources/rest-api-spec/test/runtime_fields/10_keyword.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ setup:
2525
type: script
2626
runtime_type: keyword
2727
script: |
28-
String dow = doc['timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT);
29-
if (dow.startsWith('T')) {
30-
value(dow);
28+
for (String dow: doc['day_of_week']) {
29+
if (dow.startsWith('T')) {
30+
value(dow);
31+
}
3132
}
3233
3334
- do:

0 commit comments

Comments
 (0)