// create an instance of the highlighter with the tags used to surround
// highlighted text
Highlighter highlighter = new Highlighter(this, new QueryTermScorer(query));
for (int i = 0; i < hits.totalHits; i++) {
String text = multiSearcher.doc(hits.scoreDocs[i].doc).get(FIELD_NAME);
TokenStream tokenStream = analyzer.tokenStream(FIELD_NAME, new StringReader(text));
String highlightedText = highlighter.getBestFragment(tokenStream, text);
if (VERBOSE) System.out.println(highlightedText);
}
assertTrue("Failed to find correct number of highlights " + numHighlights + " found",