I\'ve been using the (Java) Highlighter for Lucene (in the Sandbox package) for some time. However, this isn\'t really very accurate when it comes to matching the correct te
You could look into using Solr. http://lucene.apache.org/solr
Solr is a sort of generic search application that uses Lucene and supports highlighting. It's possible that the highlighting in Solr is usable as an API outside of Solr. You could also look at how Solr does it for inspiration.