Skip to content

Commit f7414ab

Browse files
committed
iter
1 parent 0cacf6a commit f7414ab

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

server/src/main/java/org/elasticsearch/index/mapper/DocumentParser.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import org.elasticsearch.index.query.SearchExecutionContext;
2727
import org.elasticsearch.indices.breaker.NoneCircuitBreakerService;
2828
import org.elasticsearch.plugins.internal.XContentMeteringParserDecorator;
29+
import org.elasticsearch.search.lookup.LeafFieldLookupProvider;
2930
import org.elasticsearch.search.lookup.SearchLookup;
3031
import org.elasticsearch.search.lookup.Source;
3132
import org.elasticsearch.xcontent.XContentBuilder;
@@ -171,6 +172,7 @@ private static void executeIndexTimeScripts(DocumentParserContext context) {
171172
}
172173
SearchLookup searchLookup = new SearchLookup(
173174
context.mappingLookup().indexTimeLookup()::get,
175+
fieldName -> context.mappingLookup().getMapper(fieldName) == null,
174176
(ft, lookup, fto) -> ft.fielddataBuilder(
175177
new FieldDataContext(
176178
context.indexSettings().getIndex().getName(),
@@ -180,7 +182,8 @@ private static void executeIndexTimeScripts(DocumentParserContext context) {
180182
fto
181183
)
182184
).build(new IndexFieldDataCache.None(), new NoneCircuitBreakerService()),
183-
(ctx, doc) -> Source.fromBytes(context.sourceToParse().source())
185+
(ctx, doc) -> Source.fromBytes(context.sourceToParse().source()),
186+
LeafFieldLookupProvider.fromStoredFields()
184187
);
185188
// field scripts can be called both by the loop at the end of this method and via
186189
// the document reader, so to ensure that we don't run them multiple times we

0 commit comments

Comments
 (0)