OpenSearch/modules
Luca Cavanna f769821bc8
Pass SearchLookup supplier through to fielddataBuilder (#61430) (#61638)
Runtime fields need to have a SearchLookup available, when building their fielddata implementations, so that they can look up other fields, runtime or not.

To achieve that, we add a Supplier<SearchLookup> argument to the existing MappedFieldType#fielddataBuilder method.

As we introduce the ability to look up other fields while building fielddata for mapped fields, we implicitly add the ability for a field to require other fields. This requires some protection mechanism that detects dependency cycles to prevent stack overflow errors.

With this commit we also introduce detection for cycles, as well as a limit on the depth of the references for a runtime field. Note that we also plan on introducing cycles detection at compile time, so the runtime cycles detection is a last resort to prevent stack overflow errors but we hope that we can reject runtime fields from being registered in the mappings when they create a cycle in their definition.

Note that this commit does not introduce any production implementation of runtime fields, but is rather a pre-requisite to merge the runtime fields feature branch.

This is a breaking change for MapperPlugins that plug in a mapper, as the signature of MappedFieldType#fielddataBuilder changes from taking a single argument (the index name), to also accept a Supplier<SearchLookup>.

Relates to #59332

Co-authored-by: Nik Everett <nik9000@gmail.com>
2020-08-27 18:09:56 +02:00
..
aggs-matrix-stats Replace AggregatorTestCase#search with AggregatorTestCase#searchAndReduce (#60816) 2020-08-10 17:23:00 +02:00
analysis-common Do not create two loggers for DeprecationLogger backport(#58435) (#61530) 2020-08-26 16:04:02 +02:00
geo Add search `fields` parameter to support high-level field retrieval. (#60258) 2020-07-28 10:58:20 -07:00
ingest-common Do not create two loggers for DeprecationLogger backport(#58435) (#61530) 2020-08-26 16:04:02 +02:00
ingest-geoip Replace immediate task creations by using task avoidance api (#60071) (#60504) 2020-07-31 13:09:04 +02:00
ingest-user-agent Do not create two loggers for DeprecationLogger backport(#58435) (#61530) 2020-08-26 16:04:02 +02:00
kibana [7.x] Introduce javaRestTest source set/task and convert modules (#59939) (#60026) 2020-07-28 08:39:11 -05:00
lang-expression Pass SearchLookup supplier through to fielddataBuilder (#61430) (#61638) 2020-08-27 18:09:56 +02:00
lang-mustache Do not create two loggers for DeprecationLogger backport(#58435) (#61530) 2020-08-26 16:04:02 +02:00
lang-painless Pass SearchLookup supplier through to fielddataBuilder (#61430) (#61638) 2020-08-27 18:09:56 +02:00
mapper-extras Pass SearchLookup supplier through to fielddataBuilder (#61430) (#61638) 2020-08-27 18:09:56 +02:00
parent-join Pass SearchLookup supplier through to fielddataBuilder (#61430) (#61638) 2020-08-27 18:09:56 +02:00
percolator Pass SearchLookup supplier through to fielddataBuilder (#61430) (#61638) 2020-08-27 18:09:56 +02:00
rank-eval [7.x] Introduce javaRestTest source set/task and convert modules (#59939) (#60026) 2020-07-28 08:39:11 -05:00
reindex Do not create two loggers for DeprecationLogger backport(#58435) (#61530) 2020-08-26 16:04:02 +02:00
repository-url [7.x] Introduce javaRestTest source set/task and convert modules (#59939) (#60026) 2020-07-28 08:39:11 -05:00
systemd Encapsulate systemd extender 2020-04-20 21:17:42 -04:00
transport-netty4 Merge test runner task into RestIntegTest (7.x backport) (#60600) 2020-08-04 14:46:32 +02:00
build.gradle Apply 2-space indent to all gradle scripts (#49071) 2019-11-14 11:01:23 +00:00