-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Description
We currently support _source filtering both on indexing time and read time using include/exclude terms. Currently, the logic is aggressively removing objects where all the fields has been removed, trying to make things as compact as possible. For example, consider the following document:
{
obj: { f: 1 }
}
using exclude=['obj.f'], will return {} because the obj now becomes empty. However, the same exclude=['obj.f'] will return { obj : { d : 1 } if the original document is:
{
obj: { f: 1, d :1 }
}
This causes client code interested in obj.d to need to always have to test whether obj is there before checking if obj.d exists. This can be cumbersome but also is not expected as the obj.f was excluded but not obj
This should change and only remove objects if they explicitly match an exclude (like exclude=['obj']), maintaining the object structure.