# ES Index Data for Expected results

**URL:** https://discuss.elastic.co/t/es-index-data-for-expected-results/21368
**Category:** Elasticsearch
**Created:** [December 23, 2014, 11:03am UTC](https://discuss.elastic.co/t/es-index-data-for-expected-results/21368 "2014-12-23T11:03:19Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Sameer\_Soni](https://avatars.discourse-cdn.com/v4/letter/s/a587f6/32.png) [@Sameer\_Soni](https://discuss.elastic.co/u/Sameer_Soni)
#### Post date: [December 23, 2014, 11:03am UTC](https://discuss.elastic.co/t/es-index-data-for-expected-results/21368/1 "2014-12-23T11:03:19Z")

</div>

Hi Guys,  
This question may have been asked before, but I couldn't find relevant  
answer so I am asking here.

I have a collection of Books, and each Book has contents composed in  
Chapters & Non-Chapters.  
I want to index these Books with contents and identify the content type, ie  
is it Chapter & Non-Chapter, and return collections of all matching  
contents for every book.  
Finally, I want to filter search results based on number of matching books,  
and each individual result should contain matching Chapter & Non-Chapter  
only, Other non matching types should be ignored.

Can somebody guide me as to how should I index my data, and construct  
query, so that most relevant results are returned.

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/be8a187a-00d1-4d8d-ad22-1c1722ea87c7%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/be8a187a-00d1-4d8d-ad22-1c1722ea87c7%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:42am UTC](https://discuss.elastic.co/t/es-index-data-for-expected-results/21368/2 "2017-07-06T00:42:14Z")

</div>


