String[] terms = query.getTerms();
WeightedTerm[] weighted = new WeightedTerm[terms.length];
for (int i=0; i<terms.length; i++) {
weighted[i] = new WeightedTerm(1.0f, terms[i]);
}
Highlighter highlighter = new Highlighter(FORMATTER, new QueryScorer(weighted));
TokenStream tokens = analyzer.tokenStream("content", new StringReader(text));
Summary summary = new Summary();
try {
// TODO : The max number of fragments (3) should be configurable
String[] result = highlighter.getBestFragments(tokens, text, 3);
for (int i=0; i<result.length; i++) {
String[] parts = result[i].split(SEPARATOR);
boolean highlight = false;
for (int j=0; j<parts.length; j++) {
if (highlight) {