elasticsearch icon indicating copy to clipboard operation
elasticsearch copied to clipboard

Synthetic _source: support `field` in many cases

Open nik9000 opened this issue 2 years ago • 4 comments

This adds support for the field scripting API in many but not all cases. Before this change numbers, dates, and IPs supported the field API when running with _source in synthetic mode because they always have doc values. This change adds support for match_only_text, stored keyword fields, and stored text fields. Two remaining field configurations work with synthetic _source and do not work with field:

  • A text field with a sub-keyword field that has doc_values
  • A text field with a sub-keyword field that is stored

image

nik9000 avatar Sep 08 '22 20:09 nik9000

Pinging @elastic/es-analytics-geo (Team:Analytics)

elasticsearchmachine avatar Sep 09 '22 13:09 elasticsearchmachine

Hi @nik9000, I've created a changelog YAML for you.

elasticsearchmachine avatar Sep 09 '22 13:09 elasticsearchmachine

Pinging @elastic/es-search (Team:Search)

elasticsearchmachine avatar Sep 13 '22 19:09 elasticsearchmachine

@romseygeek could you have another look? It's much bigger now....

nik9000 avatar Sep 14 '22 19:09 nik9000

run elasticsearch-ci/part-1

nik9000 avatar Nov 07 '22 11:11 nik9000

run elasticsearch-ci/part-1

nik9000 avatar Nov 07 '22 11:11 nik9000

So I know that I asked for the information about synthetic source to be moved to FieldDataContext but I have, annoyingly, changed my mind about that again. FDC holds information at the context in which field data is being asked for, and synthetic source is entirely orthogonal to that. I've opened #91400 to move this to MapperBuilderContext, which I think will fit better here as well - field types can get a constructor parameter telling them if they need to load things from a secret stored field or just use source.

romseygeek avatar Nov 08 '22 12:11 romseygeek