Skip to content

Empty objects are not stored in _source when an include/exclude list is present #4047

@RobCherry

Description

@RobCherry
curl -XDELETE localhost:9200/test
curl -XPUT localhost:9200/test/test/1 -d '{ "empty": {}, "not_empty": { "key": "value" } }'
curl localhost:9200/test/test/1/_source

Returns { "empty": {}, "not_empty": { "key": "value" } } as expected.

curl -XDELETE localhost:9200/test
curl -XPUT localhost:9200/test
curl -XPUT localhost:9200/test/test/_mapping -d '{ "test": { "_source" : { "excludes": [ "ignored" ] } } }'
curl -XPUT localhost:9200/test/test/1 -d '{ "empty": {}, "not_empty": { "key": "value" } }'
curl localhost:9200/test/test/1/_source

Returns {"not_empty":{"key":"value"}} which is not expected.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions