# Parent/Child searching/faceting/sorting

**URL:** https://discuss.elastic.co/t/parent-child-searching-faceting-sorting/12763
**Category:** Elasticsearch
**Created:** [July 12, 2013, 7:29am UTC](https://discuss.elastic.co/t/parent-child-searching-faceting-sorting/12763 "2013-07-12T07:29:56Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Maarten\_Roosendaal](https://avatars.discourse-cdn.com/v4/letter/m/49beb7/32.png) [@Maarten\_Roosendaal](https://discuss.elastic.co/u/Maarten_Roosendaal)
#### Post date: [July 12, 2013, 7:29am UTC](https://discuss.elastic.co/t/parent-child-searching-faceting-sorting/12763/1 "2013-07-12T07:29:56Z")

</div>

Hi,

We have the following requirements which we're not sure of that  
elasticsearch can provide a solution, they relate to the model: 1 product  
[title, description, etc..] can have many offers [price, availability,  
seller, etc...]:

1. we need to be able to search for products that match the term a user  
types --\> easy, no sweat.
2. the product facets are clear, but we also want to be able to create  
facets for the childvalues [eg. price, availability, etc..] and....
3. they should NOT reflect the nr of offers but the number of products  
(sort of an aggregated value). So for a pricefacet 5-10 euros and 2 offers  
for 1 product that fall in that range (as a result of a query), we only  
want to show that there is 1 product in that range.
4. the id of most relevant offer should be returned as a childvalue, we  
use another system to get and display detailed offer information
5. ability to sort on the value of child documents (eg. price low-high)

1 is clear but we're not sure how to do 2-5. Maybe using parent/child is  
the wrong choice but we want to do that because offer updates occur very  
often, product updates not that much.

I'm using the  
[http://www.spacevatican.org/2012/6/3/fun-with-elasticsearch-s-children-and-nested-documents/](http://www.spacevatican.org/2012/6/3/fun-with-elasticsearch-s-children-and-nested-documents/) site  
as a basis.

Hope you can provide some answers/insight.

Cheers,  
Maarten

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 6, 2017, 2:26am UTC](https://discuss.elastic.co/t/parent-child-searching-faceting-sorting/12763/2 "2017-07-06T02:26:50Z")

</div>


