When using nested inner hits feature and source filtering on the inner hit the included fields are not returned. This is specifying the include path relative to the nested object (which is how it is returned in results without filtering). If I specify the include using the absolute path, I get a result but the source is no longer returned relative to the nested object.
If I have this document:
{"nested":[{"nested_field": "some value"}]}
Without filtering, a nested inner hit response would return:
..."_source": {"nested_field": "some value"}
If I set the inner hit source filtering to include nested_field I get:
And if I set the inner hit source filtering to include nested.nested_field I get:
..."_source": {"nested": {"nested_field": "some value"}}
This is on elasticsearch 5.2.0.
/cc @martijnvg @tlrx
When using nested inner hits feature and source filtering on the inner hit the included fields are not returned. This is specifying the include path relative to the nested object (which is how it is returned in results without filtering). If I specify the include using the absolute path, I get a result but the source is no longer returned relative to the nested object.
If I have this document:
{"nested":[{"nested_field": "some value"}]}Without filtering, a nested inner hit response would return:
..."_source": {"nested_field": "some value"}If I set the inner hit source filtering to include
nested_fieldI get:..."_source": {}And if I set the inner hit source filtering to include
nested.nested_fieldI get:..."_source": {"nested": {"nested_field": "some value"}}This is on elasticsearch 5.2.0.
/cc @martijnvg @tlrx