OpenSearch/x-pack/plugin
Luca Cavanna 862fab06d3
Share same existsQuery impl throughout mappers (#57607)
Most of our field types have the same implementation for their `existsQuery` method which relies on doc_values if present, otherwise it queries norms if available or uses a term query against the _field_names meta field. This standard implementation is repeated in many different mappers.

There are field types that only query doc_values, because they always have them, and field types that always query _field_names, because they never have norms nor doc_values. We could apply the same standard logic to all of these field types as `MappedFieldType` has the knowledge about what data structures are available.

This commit introduces a standard implementation that does the right thing depending on the data structure that is available. With that only field types that require a different behaviour need to override the existsQuery method.

At the same time, this no longer forces subclasses to override `existsQuery`, which could be forgotten when needed. To address this we introduced a new test method in `MapperTestCase` that verifies the `existsQuery` being generated and its consistency with the available data structures.
2020-09-23 11:00:53 +02:00
..
analytics Share same existsQuery impl throughout mappers (#57607) 2020-09-23 11:00:53 +02:00
async [7.x] Remove integTest task from PluginBuildPlugin (#61879) (#62135) 2020-09-09 14:25:41 -05:00
async-search Make keep alive optional in PointInTimeBuilder (#62720) 2020-09-22 18:52:54 -04:00
autoscaling Autoscaling decision return absolute capacity (#61575) (#62670) 2020-09-19 09:05:23 +02:00
ccr Dedicated threadpool for system index writes (#62792) 2020-09-22 15:31:38 -06:00
core Make keep alive optional in PointInTimeBuilder (#62720) 2020-09-22 18:52:54 -04:00
data-streams Move stored flag from TextSearchInfo to MappedFieldType (#62717) (#62770) 2020-09-23 09:40:34 +02:00
deprecation [7.x] Fix projects that failed to build within Intellij (#62258) (#62408) 2020-09-17 17:45:12 -05:00
enrich Dedicated threadpool for system index writes (#62792) 2020-09-22 15:31:38 -06:00
eql Make keep alive optional in PointInTimeBuilder (#62720) 2020-09-22 18:52:54 -04:00
frozen-indices Make keep alive optional in PointInTimeBuilder (#62720) 2020-09-22 18:52:54 -04:00
graph [7.x] Remove integTest task from PluginBuildPlugin (#61879) (#62135) 2020-09-09 14:25:41 -05:00
identity-provider [7.x] Remove integTest task from PluginBuildPlugin (#61879) (#62135) 2020-09-09 14:25:41 -05:00
ilm ILM: allow check-migration step to continue if tier setting unset (#62636) (#62724) 2020-09-21 20:40:01 +01:00
logstash Add refresh policy to logstash plugin write requests (#62583) (#62665) 2020-09-18 17:44:53 -04:00
mapper-constant-keyword Share same existsQuery impl throughout mappers (#57607) 2020-09-23 11:00:53 +02:00
mapper-flattened Share same existsQuery impl throughout mappers (#57607) 2020-09-23 11:00:53 +02:00
ml [7.x] [ML] changing to not use global bulk indexing parameters in conjunction with add(object) calls (#62694) (#62784) 2020-09-22 15:07:08 -04:00
monitoring [7.x] Remove integTest task from PluginBuildPlugin (#61879) (#62135) 2020-09-09 14:25:41 -05:00
ql Fix Eclipse build (#62733) (#62786) 2020-09-22 17:44:25 -04:00
repositories-metering-api [7.x] Remove integTest task from PluginBuildPlugin (#61879) (#62135) 2020-09-09 14:25:41 -05:00
rollup [7.x] Generalize AsyncTwoPhaseIndexer first phase (#61739) (#62482) 2020-09-17 11:57:22 +03:00
runtime-fields Share same existsQuery impl throughout mappers (#57607) 2020-09-23 11:00:53 +02:00
search-business-rules [7.x] Remove integTest task from PluginBuildPlugin (#61879) (#62135) 2020-09-09 14:25:41 -05:00
searchable-snapshots Add test for snapshot incrementality of snapshot-backed indices (#62641) 2020-09-21 12:06:47 +02:00
security Fix doc-update interceptor for indices with DLS and FLS (#61516) 2020-09-23 08:55:22 +03:00
spatial Share same existsQuery impl throughout mappers (#57607) 2020-09-23 11:00:53 +02:00
sql Fix Eclipse build (#62733) (#62786) 2020-09-22 17:44:25 -04:00
src EQL: Remove support for `=` for comparisons (#62756) (#62775) 2020-09-22 20:56:04 +02:00
stack [7.x] Add "synthetics-*-*" templates for synthetics fleet data (#62193) (#62346) 2020-09-14 17:14:34 -06:00
transform [7.x] Generalize AsyncTwoPhaseIndexer first phase (#61739) (#62482) 2020-09-17 11:57:22 +03:00
vectors Share same existsQuery impl throughout mappers (#57607) 2020-09-23 11:00:53 +02:00
versionfield Share same existsQuery impl throughout mappers (#57607) 2020-09-23 11:00:53 +02:00
voting-only-node [7.x] Remove integTest task from PluginBuildPlugin (#61879) (#62135) 2020-09-09 14:25:41 -05:00
watcher [7.x] Remove integTest task from PluginBuildPlugin (#61879) (#62135) 2020-09-09 14:25:41 -05:00
wildcard Share same existsQuery impl throughout mappers (#57607) 2020-09-23 11:00:53 +02:00
build.gradle Fix Eclipse build (#62733) (#62786) 2020-09-22 17:44:25 -04:00