From 42a1d25064edd6db5815a3d172891145ef9ecb7f Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Mon, 29 Oct 2012 15:27:26 +0100 Subject: [PATCH] lucene 4: Fixed last compile errors in HighlightPhase --- .../org/elasticsearch/search/highlight/HighlightPhase.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/elasticsearch/search/highlight/HighlightPhase.java b/src/main/java/org/elasticsearch/search/highlight/HighlightPhase.java index dc378de73ed..509d2441399 100644 --- a/src/main/java/org/elasticsearch/search/highlight/HighlightPhase.java +++ b/src/main/java/org/elasticsearch/search/highlight/HighlightPhase.java @@ -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) {