# How to index a book

**URL:** https://discuss.elastic.co/t/how-to-index-a-book/325448
**Category:** Elasticsearch
**Created:** [February 14, 2023, 7:56am UTC](https://discuss.elastic.co/t/how-to-index-a-book/325448 "2023-02-14T07:56:18Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Piyush\_Purohit](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/piyush_purohit/32/117211_2.png) [@Piyush\_Purohit](https://discuss.elastic.co/u/Piyush_Purohit)
#### Post date: [February 14, 2023, 7:56am UTC](https://discuss.elastic.co/t/how-to-index-a-book/325448/1 "2023-02-14T07:56:18Z")

</div>

## I want to index a book, in that I want to store book\_name,page\_number and page\_content following is sample - { "book\_name": "first", "pages" : [{ "page\_number" : 1, "page\_content" : "test data for check." }, { "page\_number" : 2, "page\_content" : "test data for check. for test. test" }, { "page\_number" : 3, "page\_content" : "So we beat on, boats against the current, borne back ceaselessly into the past." }] }

## { "book\_name": "second", "pages" : [{ "page\_number" : 1, "page\_content" : "data for check. test and test" }, { "page\_number" : 2, "page\_content" : "test data for check. for . test the data" }, { "page\_number" : 3, "page\_content" : "sample second.test and test" }] }

{  
"book\_name": "third",  
"pages" : [  
{  
"page\_number" : 1,  
"page\_content" : "data for test. test test test test"  
},  
{  
"page\_number" : 2,  
"page\_content" : " the data"  
},  
{  
"page\_number" : 3,  
"page\_content" : "sample third."  
}  
]  
}  
now I should make a search query that should look on ALL pages of each book and give me score of the whole book(all pages) .

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [February 14, 2023, 8:54am UTC](https://discuss.elastic.co/t/how-to-index-a-book/325448/2 "2023-02-14T08:54:56Z")

</div>

Welcome to our community! 😃

Please format your code/logs/config using the `</>` button, or markdown style back ticks. It helps to make things easy to read which helps us help you 🙂

---

<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: [March 14, 2023, 8:55am UTC](https://discuss.elastic.co/t/how-to-index-a-book/325448/3 "2023-03-14T08:55:38Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
