lucene 4: Fixed last compile errors in HighlightPhase

This commit is contained in:
Martijn van Groningen 2012-10-29 15:27:26 +01:00 committed by Shay Banon
parent b928e74904
commit 42a1d25064
1 changed files with 2 additions and 2 deletions

View File

@ -186,8 +186,8 @@ public class HighlightPhase extends AbstractComponent implements FetchSubPhase {
try {
for (Object textToHighlight : textsToHighlight) {
String text = textToHighlight.toString();
Analyzer analyzer = context.mapperService().documentMapper(hitContext.hit().type()).mappers().indexAnalyzer()
TokenStream tokenStream = analyzer.reusableTokenStream(mapper.names().indexName(), new FastStringReader(text));
Analyzer analyzer = context.mapperService().documentMapper(hitContext.hit().type()).mappers().indexAnalyzer();
TokenStream tokenStream = analyzer.tokenStream(mapper.names().indexName(), new FastStringReader(text));
TextFragment[] bestTextFragments = entry.highlighter.getBestTextFragments(tokenStream, text, false, numberOfFragments);
for (TextFragment bestTextFragment : bestTextFragments) {
if (bestTextFragment != null && bestTextFragment.getScore() > 0) {