Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
RobCherry opened this issue Nov 1, 2013 · 0 comments
Assignees

Comments

@RobCherry
Copy link
Contributor

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.

@ghost ghost assigned bleskes Nov 2, 2013
RobCherry added a commit to RobCherry/elasticsearch that referenced this issue Nov 4, 2013
RobCherry added a commit to RobCherry/elasticsearch that referenced this issue Nov 21, 2013
RobCherry added a commit to RobCherry/elasticsearch that referenced this issue Nov 25, 2013
bleskes pushed a commit to bleskes/elasticsearch that referenced this issue Jan 14, 2014
When excluding '*.f1' from `{ "obj": { "f1": 1, "f2": 2 } }` XContentMapValues.filter returns `{ "obj": { "f2": 2}}`. When run on `{ "obj": { "f1" : 1 }}` we should return `{ "obj": { }}` to maintain object structure. People currently need to always check whether `obj` is there or not.

Closes elastic#4715
Closes elastic#4047
Related to elastic#4491
brusic pushed a commit to brusic/elasticsearch that referenced this issue Jan 19, 2014
When excluding '*.f1' from `{ "obj": { "f1": 1, "f2": 2 } }` XContentMapValues.filter returns `{ "obj": { "f2": 2}}`. When run on `{ "obj": { "f1" : 1 }}` we should return `{ "obj": { }}` to maintain object structure. People currently need to always check whether `obj` is there or not.

Closes elastic#4715
Closes elastic#4047
Related to elastic#4491
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment