[ Parent / Child ] Search on child but facet on parents


(Tchinkatchuk) #1

Hi all,

I have 2 types of documents ( categories & products ).

Categories could have parent (other categories) so it is a kind of nested
tree.
Products have a parent (categories)

I am doing search on products terms. But I want to have classifications
facets for those results (ideally as a nested tree).

I have no clue of the solution. Could anyone telle me if this is possible ?

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/2008a14f-d127-4791-9653-1be316d492d2%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Alexander Reelsen) #2

Hey,

not too sure, what you are after with your classification, but you could
execute an aggregation with a has_child filter, which returns the product
category of a certain product.
However I am not sure, if this is the right approach, as in most systems a
product can have more than one category I guess (and you can only define
one parent). Maybe you want to put your category ids into an array of the
product and call aggregations on that array to get category statistics, but
this is highly dependent on your use-case.

--Alex

On Sun, Feb 16, 2014 at 1:01 PM, Georges@Bibtol sg@quable.fr wrote:

Hi all,

I have 2 types of documents ( categories & products ).

Categories could have parent (other categories) so it is a kind of nested
tree.
Products have a parent (categories)

I am doing search on products terms. But I want to have classifications
facets for those results (ideally as a nested tree).

I have no clue of the solution. Could anyone telle me if this is possible ?

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/2008a14f-d127-4791-9653-1be316d492d2%40googlegroups.com
.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAGCwEM9f-W9ycBe%3Db-jfuQNyi61YOn4S8mRmwT-GruF9-hUELA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


(system) #3