# How to get the line from which I get my search results

**URL:** <https://discuss.elastic.co/t/how-to-get-the-line-from-which-i-get-my-search-results/52726>\
**Category:** Elasticsearch\
**Created:** [June 14, 2016, 11:16am UTC](https://discuss.elastic.co/t/how-to-get-the-line-from-which-i-get-my-search-results/52726 "2016-06-14T11:16:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![siddharth\_gupta](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@siddharth\_gupta](https://discuss.elastic.co/u/siddharth_gupta)\
**Post date:** [June 14, 2016, 11:16am UTC](https://discuss.elastic.co/t/how-to-get-the-line-from-which-i-get-my-search-results/52726/1 "2016-06-14T11:16:00Z")

</div>

I have indexed around 120k documents with 13 fields in each.

Out of the 13 fields one of them is "content" field.

When I type a query i want to know from which line are the results coming from.

Is it possible ?  
Can anybody please help ?

Thanks & Regards,  
Siddharth.

---

<div class="post-metadata">

**Author:** ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)\
**Post date:** [June 14, 2016, 11:24am UTC](https://discuss.elastic.co/t/how-to-get-the-line-from-which-i-get-my-search-results/52726/2 "2016-06-14T11:24:19Z")

</div>

Hi @siddharth_gupta,

Elasticsearch does not know about lines but maybe its [highlighting](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-highlighting.html) capability helps you.

Daniel

---

<div class="post-metadata">

**Author:** ![siddharth\_gupta](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@siddharth\_gupta](https://discuss.elastic.co/u/siddharth_gupta)\
**Post date:** [June 14, 2016, 11:43am UTC](https://discuss.elastic.co/t/how-to-get-the-line-from-which-i-get-my-search-results/52726/4 "2016-06-14T11:43:34Z")

</div>

Thanks for the reply !

My scenario ::

"content" : {  
`<p id=\"p_1\">`  
Text1  
`<p id=\"p_2\">`  
Text2  
`<p id=\"p_3\">`

Text3  
`<p id=\"p_4\">`  
Text4  
`<p id=\"p_5\">`  
Text5}

So from the response I want to check which 'p tag' has the most relevant text related to my user query.  
Do you get my point ?

Please let me know if I missing something.`indent preformatted text by 4 spaces`

---

<div class="post-metadata">

**Author:** ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)\
**Post date:** [June 14, 2016, 11:59am UTC](https://discuss.elastic.co/t/how-to-get-the-line-from-which-i-get-my-search-results/52726/5 "2016-06-14T11:59:38Z")

</div>

Hi @siddharth_gupta,

well, the highlighting capability allows you to put special HTML tags around the parts that matched. Based on your description it maybe _could_ make sense that you index each paragraph as individual document in Elasticsearch (I could very well also be mistaken as I don't know your exact use case).

Daniel

---

<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 5, 2017, 10:43pm UTC](https://discuss.elastic.co/t/how-to-get-the-line-from-which-i-get-my-search-results/52726/6 "2017-07-05T22:43:57Z")

</div>


