Hi Everyone,

I am looking for a little guidance on how to setup my indexes to support 
sorting a nested array. To give a simple example, we have an index of 
products in our index, below is a dummy example document:

/products/product/<partnumber>

{
     "name":"Toaster",
     "desc":"For making toast",
     "price":29.99,
     "reviews":[
          {
               "rating" : 5,
               "comment" : "works great!"
          },          
          {
               "rating" : 1,
               "comment" : "Ugh!!"
          },          
          {
               "rating" : 3,
               "comment" : "Meh"
          }
     ]
}


I would like to be able to query for product documents, but be able to sort 
the reviews array based on the rating. A customer could ask to see the 
first 10 best reviews, or the worst 5 reviews for example. Is this 
possible? Is this possible if the reviews are in a separate index and I 
execute a join query?

Any information or guidance would be extremely helpful!

Thanks!

Darin

-- 
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/500b16ff-b00f-44a9-a238-9c7a09432bfa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to