I'm using nested documents in ES. I have nested array inside one entity and
I would like to be able to filter array with nested query (not just filter
root/parent doc but nested array also).
Nested filters enable to filter root doc. For example, if I have index
'blogs' and type 'blog' and inside blog document I have property 'comments'
(array of comments), with
{"type": "nested" } in mappings, So for example I want to filter blogs that
have comments that have title like 'today' (for example with match query)
but in every blog I also want to show only comments that contains 'today'
in title.
I know how nested filterworks. Also child-parent relationship isn't good
for this purpose because there is no child documents in response as part of
parent document.
Is there any way to do this directly in elasticsearch, without adding extra
logic to application, which may affect performance ?
Or is there and plans to add this as new option in nested query/filter in
next versions or something similar ?
I don't believe this is possible today, but I would love to be wrong
Bob
On Sunday, 5 May 2013 08:16:36 UTC-4, aldm wrote:
Hi,
I'm using nested documents in ES. I have nested array inside one entity
and I would like to be able to filter array with nested query (not just
filter root/parent doc but nested array also).
Nested filters enable to filter root doc. For example, if I have index
'blogs' and type 'blog' and inside blog document I have property 'comments'
(array of comments), with
{"type": "nested" } in mappings, So for example I want to filter blogs
that have comments that have title like 'today' (for example with match
query) but in every blog I also want to show only comments that contains
'today' in title.
I know how nested filterworks. Also child-parent relationship isn't good
for this purpose because there is no child documents in response as part of
parent document.
Is there any way to do this directly in elasticsearch, without adding
extra logic to application, which may affect performance ?
Or is there and plans to add this as new option in nested query/filter in
next versions or something similar ?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.