OpenSearch/plugins/mapper-annotated-text/src
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
..
internalClusterTest/java/org/elasticsearch/index/mapper/annotatedtext Implement fields fetch for runtime fields (backport of #61995) (#62416) 2020-09-15 20:24:10 -04:00
main/java/org/elasticsearch Share same existsQuery impl throughout mappers (#57607) 2020-09-23 11:00:53 +02:00
test/java/org/elasticsearch Speed up empty highlighting many fields (backport of #61860) (#62122) 2020-09-08 15:49:50 -04:00
yamlRestTest [7.x] Convert most OSS plugins from integTest to [yaml | java]RestTest or internalClusterTest (#59444) (#60343) 2020-07-29 13:06:13 -05:00