Elasticsearch: inner_hits does not work for nested queries (nested twice) -
i'm using es v1.5.2 (so inner_hits
present , work correctly filters) , have nested documents in elasticsearch nested paths :
- members
- members.members
this means in mapping (https://gist.github.com/frickm/834a4ff8f952cb86ec02) these 2 fields declared nested
. have working query (which doubly nested filter on un-analyzed strings) shown below , work fine (my actual use-case has deeper nesting).
i have 2 inner_hits
clauses in query: outer work works
the problem "inner" inner_hits
not work: first inner_hits clause obtain "real" inner-hits members
field; second inner_hits
clause following result members.members
field, wrong (the hits cannot empty, since entire document wouldn't hit):
"members.members": { "hits": { "total": 0, "max_score": null, "hits": [] } }
query:
post nia/condition/_search { "query": { "filtered": { "query": { "match_all": {} }, "filter": { "nested": { "path": "members", "filter": { "bool": { "must": [ { "nested": { "path": "members.members", "filter": { "bool": { "must": [ { "term": { "members.members.findingref.name": "impairedsenseoftouch" } } ] } }, "inner_hits": {} } } ] } }, "inner_hits": {} } } } } }
remark: replacing bool
filter direct term
filter not either (and shouldn't matter since entire "sub-documents' supposed given back).
Comments
Post a Comment