I'm doing some highlighting with the following code fragment: formatter = new SimpleHTMLFormatter(<b>, </b>); Scorer score = new QueryScorer(myQuery); ht = new Highlighter(formatter, score); ht.setTextFragmenter(new NullFragmenter()); markedString = ht.getBestFragment(ctf, myText);
However, if myQuery has a phrase like "john smith", then it will highlight "john" every place it sees it and "smith" everyplace it sees it regardless of whether they are together. Is this expected behavior? Is there any way to get phrases to be properly highlighted?