How to filter nested array in response?

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 ?

Thanks

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

This looks very similiar to the question I just posted:

https://groups.google.com/forum/?fromgroups=#!topic/elasticsearch/x1Mmnpudig0

I don't believe this is possible today, but I would love to be wrong :slight_smile:

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 ?

Thanks

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.