Apache Lucene open-source search software
SOLR-2474: The helper TokenStreams in analysis.jsp and AnalysisRequestHandlerBase did not clear all attributes so they displayed incorrect attribute values for tokens in later filter stages
Uwe Schindler20f261ca14d2
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex 0af4aab2fd6..dfdeae46c12 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -291,6 +291,10 @@ Bug Fixes* SOLR-2390: Performance of usePhraseHighlighter is terrible on very large Documents,regardless of hl.maxDocCharsToAnalyze. (Mark Miller)+* SOLR-2474: The helper TokenStreams in analysis.jsp and AnalysisRequestHandlerBase+ did not clear all attributes so they displayed incorrect attribute values for tokens+ in later filter stages. (uschindler, rmuir, yonik)+Other Changes----------------------diff --git a/solr/src/java/org/apache/solr/handler/AnalysisRequestHandlerBase.java b/solr/src/java/org/apache/solr/handler/AnalysisRequestHandlerBase.javaindex 7fc91156c06..7049c94262e 100644--- a/solr/src/java/org/apache/solr/handler/AnalysisRequestHandlerBase.java+++ b/solr/src/java/org/apache/solr/handler/AnalysisRequestHandlerBase.java@@ -337,6 +337,7 @@ public abstract class AnalysisRequestHandlerBase extends RequestHandlerBase {@Overridepublic boolean incrementToken() throws IOException {if (tokenIterator.hasNext()) {+ clearAttributes();AttributeSource next = tokenIterator.next();Iterator<Class<? extends Attribute>> atts = next.getAttributeClassesIterator();while (atts.hasNext()) // make sure all att impls in the token exist herediff --git a/solr/src/webapp/web/admin/analysis.jsp b/solr/src/webapp/web/admin/analysis.jspindex bd246d04a8e..43c8ae5b5e3 100644--- a/solr/src/webapp/web/admin/analysis.jsp+++ b/solr/src/webapp/web/admin/analysis.jsp@@ -222,6 +222,7 @@public boolean incrementToken() throws IOException {if (iter.hasNext()) {+ clearAttributes();AttributeSource token = iter.next();Iterator<Class<? extends Attribute>> atts = token.getAttributeClassesIterator();while (atts.hasNext()) // make sure all att impls in the token exist here