Nested Document sorting and filtering


(Srinivasan Ramaswamy) #1

Hi

I have a document structure as follows

productId, productName, [ {tag1, tag_name, price, tag_category}, {tag2,
tag_name, price, tag_category}, ...]

where tags is a nested document within a product. Each product is a unique
item, but different merchants can sell the same product (called tags) so
the price is different and hence the popularity is also different.

Here are my questions

  1. I would like to filter the products by tag_category. I read that nested
    filter can do this for me. In addition to returning all the products with a
    particular tag_category, can it also return only the tags with the
    specified tag_category within a product ?

  2. Is there a way to sort the tags (nested documents) by tag price ? with
    or without the tag_category constraints

  3. In my index each product can have an average of 100 tags and i have 10m
    products and 1bn tags in total. Would you recommend nested document
    approach or parent-child approach. From what i have read till now I felt
    nested document is better.

Thanks
Srini

--
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/6e41c810-b41c-4180-8eb3-3b0a0cf7110a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Srinivasan Ramaswamy) #2

From what i read here
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html#_nested_sorting_example

I understand that sorting is supported within a nested field.

In case of nested_filter i would like to filter out the nested documents
that doesnt match the query. I read in the forum that that feature is in
development.

Please correct me if i am wrong.

Thanks
Srini

On Tuesday, April 15, 2014 12:06:30 PM UTC-7, Srinivasan Ramaswamy wrote:

Hi

I have a document structure as follows

productId, productName, [ {tag1, tag_name, price, tag_category}, {tag2,
tag_name, price, tag_category}, ...]

where tags is a nested document within a product. Each product is a unique
item, but different merchants can sell the same product (called tags) so
the price is different and hence the popularity is also different.

Here are my questions

  1. I would like to filter the products by tag_category. I read that nested
    filter can do this for me. In addition to returning all the products with a
    particular tag_category, can it also return only the tags with the
    specified tag_category within a product ?

  2. Is there a way to sort the tags (nested documents) by tag price ? with
    or without the tag_category constraints

  3. In my index each product can have an average of 100 tags and i have
    10m products and 1bn tags in total. Would you recommend nested document
    approach or parent-child approach. From what i have read till now I felt
    nested document is better.

Thanks
Srini

--
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/0b00c736-3c4a-4ded-96f0-d85c485b13a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #3