Using a match_phrase_prefix query, I've been trying to get highlights that include only the matching prefix itself. For example, for query foo and string foobar, what I would like is highlight <em>foo</em>bar, but what I get instead is <em>foobar</em>.
I've been working around this by reformatting the highlights returned by Elasticsearch in my own application code. This is a bit hacky, and lately has been found to cause some annoying bugs. I'm wondering if there's some way to construct the Elasticsearch query that will produce highlights in the way I describe naturally.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.