I use highlighting that is already part of Elasticsearch. It work fine. For example if I have next "words" indexed :
- verylongwork that isweryweeylongf
- tes!tr%31=!"$:_ae test !"daca214xx
And if I search for -> that .The result is as it folows -> verylongwork that isweryweeylongf . Including the bolding part. But if I search for -> test . The result is -> $:_ae test !" .
So the fragment gests splited/shortened.
It probably has something to do with special characters. When searching I use QueryParser.escape() to escape them.
What could be the problem ?
EDIT: Also if I search for tes the result would be two fragments -> tes!tr and $:_ae test !"