highlight one appearance of a query at a time in Elasticsearch
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?