How to fetch the offset of the highlighted word in the Elastic search result

(Harish Alwala) #1

I have indexed a book contents to Elastic search. Now from the search
results I need to navigate to the page of the book. I am looking to fetch
the offset of the search word in the results and map to the offset in the
book to get the page number.

I have seen similar question in this forum, but they have no solution in
it. I know it is easy to get it in LUCENE. I tried with TermVector in
mapping, but it does not give me the offset in the query result.

I have spend good time in elastic search documentation and other forums to
get the offsets of the highlighted search results, but I didnot get the

Any suggestions please.

Please update your bookmarks! We have moved to

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
To view this discussion on the web visit
For more options, visit

(system) #2