Index Structure for Nested Data

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.
Finally, for each query, I want to filter search results based on number of
matching books, and each individual result should contain matching Chapter
& Non-Chapter only.
For example, always 10 matching books are returned, and each result has
collection of matched Chapter & Non-Chapters.
I identify each chapter and non-chapter by specific ids and they belong to
a book which also has unique id.

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/dd1434af-1018-43f3-8b20-a2813adae16a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.