Limit number of characters before and after the highlighted word

Hi,

I used highlight for my full-text search feature however I noticed that the highlighted results seem to include many unnecessary text.

Is there a way I can limit the number of characters before and after the highlighted word?
Like the one below:

[Search Parameter]
Data: ABCDEFGHIJKLMNOPQRST
Match: KLM
Say we want to limit 4 characters before and after.

Result would be GHIJ<em>KLM</em>NOPQ

Thank you!