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

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.

Hi @siddharth_gupta,

Elasticsearch does not know about lines but maybe its highlighting capability helps you.

Daniel

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

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