_source
filtering shouldn't remove objects unless explicitly excluded
#4715
Labels
_source
filtering shouldn't remove objects unless explicitly excluded
#4715
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:using
exclude=['obj.f']
, will return{}
because theobj
now becomes empty. However, the sameexclude=['obj.f']
will return{ obj : { d : 1 }
if the original document is:This causes client code interested in
obj.d
to need to always have to test whetherobj
is there before checking ifobj.d
exists. This can be cumbersome but also is not expected as theobj.f
was excluded but notobj
This should change and only remove objects if they explicitly match an exclude (like
exclude=['obj']
), maintaining the object structure.The text was updated successfully, but these errors were encountered: