ES Index Data for Expected results

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