Skip to content

Add _source, _doc and _field support to fields #4492

Closed
@clintongormley

Description

@clintongormley

When requesting fields in the search, get, update, etc APIs, we should be able to control where those values come from with these prefixes:

  • _source: extract the field value from the _source field
  • _fields: retrieve a stored field value
  • _doc: retrieve the value from fielddata

The _doc option is particularly useful for retrieving dates as, no matter the format they're specified in in the source, they will be accessible as milliseconds-since-the-epoch from fielddata, without the need to allow dynamic scripts.

While on the subject, perhaps we should support this same syntax in scripting, instead of docs['foo']?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions