Quantcast

highlight one appearance of a query at a time in Elasticsearch

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

highlight one appearance of a query at a time in Elasticsearch

Alexandra
This post has NOT been accepted by the mailing list yet.
Let's say I have this text indexed in Elasticsearch:

Tom has apples and Mark has green apples.

Now, I'm doing a search with highlighting with the query:

has apples
When executing the query with slop 1, I will get back something like this (pretending that | is the pre and post highlight tag):

Tom |has apples| and Mark |has| green |apples|.
What I need is to know in my search response that the first "has apples" belongs to one appearance of the query and the second one to another appearance. Is there any way I could get that information?

Any advice would really help.

Thanks!
Loading...