OpenSearch/plugins
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
..
analysis-icu Share same existsQuery impl throughout mappers (#57607) 2020-09-23 11:00:53 +02:00
analysis-kuromoji Upgrade to lucene-8.7.0-snapshot-830bd186a8d. (#62596) 2020-09-18 09:51:34 +02:00
analysis-nori Upgrade to lucene-8.7.0-snapshot-830bd186a8d. (#62596) 2020-09-18 09:51:34 +02:00
analysis-phonetic Upgrade to lucene-8.7.0-snapshot-830bd186a8d. (#62596) 2020-09-18 09:51:34 +02:00
analysis-smartcn Upgrade to lucene-8.7.0-snapshot-830bd186a8d. (#62596) 2020-09-18 09:51:34 +02:00
analysis-stempel Upgrade to lucene-8.7.0-snapshot-830bd186a8d. (#62596) 2020-09-18 09:51:34 +02:00
analysis-ukrainian Upgrade to lucene-8.7.0-snapshot-830bd186a8d. (#62596) 2020-09-18 09:51:34 +02:00
discovery-azure-classic Do not create two loggers for DeprecationLogger backport(#58435) (#61530) 2020-08-26 16:04:02 +02:00
discovery-ec2 Hide c.a.s.s.i.UseArnRegionResolver noise (#62522) 2020-09-18 08:30:39 +01:00
discovery-gce Simplify adding plugins and modules to testclusters (#61886) 2020-09-03 19:37:46 -07:00
examples Merge test runner task into RestIntegTest (7.x backport) (#60600) 2020-08-04 14:46:32 +02:00
ingest-attachment Add data.path fast path for FilePermission (#61302) 2020-09-01 12:03:22 -06:00
mapper-annotated-text Share same existsQuery impl throughout mappers (#57607) 2020-09-23 11:00:53 +02:00
mapper-murmur3 Share same existsQuery impl throughout mappers (#57607) 2020-09-23 11:00:53 +02:00
mapper-size [7.x] Allow metadata fields in the _source (#62616) 2020-09-18 19:56:41 +03:00
repository-azure Faster Azure Blob InputStream (#61812) (#62387) 2020-09-15 18:27:22 +02:00
repository-gcs Add repositories metering API (#62088) 2020-09-08 14:01:04 +02:00
repository-hdfs [7.x] Remove integTest task from PluginBuildPlugin (#61879) (#62135) 2020-09-09 14:25:41 -05:00
repository-s3 Hide c.a.s.s.i.UseArnRegionResolver noise (#62522) 2020-09-18 08:30:39 +01:00
store-smb [7.x] Convert most OSS plugins from integTest to [yaml | java]RestTest or internalClusterTest (#59444) (#60343) 2020-07-29 13:06:13 -05:00
transport-nio [7.x] Remove integTest task from PluginBuildPlugin (#61879) (#62135) 2020-09-09 14:25:41 -05:00
build.gradle Apply 2-space indent to all gradle scripts (#49071) 2019-11-14 11:01:23 +00:00