Hello ,
You can do a 2 level aggregation term query with first level as category
and second level as the content.
{
"aggregations": {
"categories": {
"terms": {
"field": "category"
},
"aggregations": {
"categories": {
"terms": {
"field": "content"
}
}
}
}
}
}
Aggregations -
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations.html
Terms aggregation -
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html
Thanks
Vineeth
On Tue, Sep 2, 2014 at 8:36 PM, NM <[email protected]> wrote:
> I have a set of categories containing some products
>
> I would like to index the label and the category of the products (to
> handle record linkage).
>
> the issues is: some terms are common for some categories but could be
> discrimant for other categories.
>
> So I would like to compute the IDF of a word not for all the products but
> per category.
>
> How to handle that?
>
> 1. creating several indexes? one per category
>
> 2. or creating several objects inside an index ? one per category
>
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elasticsearch/e6b06ff9-e4ca-4ab9-a0e8-885eb93a94ea%40googlegroups.com
> <https://groups.google.com/d/msgid/elasticsearch/e6b06ff9-e4ca-4ab9-a0e8-885eb93a94ea%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAGdPd5%3DZ0dFnmQND3s%2BrFUMLMf7mNToFEqhDeW4Sw1KzTRjwsQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.