diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 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.java index 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 { @Override public boolean incrementToken() throws IOException { if (tokenIterator.hasNext()) { + clearAttributes(); AttributeSource next = tokenIterator.next(); Iterator> atts = next.getAttributeClassesIterator(); while (atts.hasNext()) // make sure all att impls in the token exist here diff --git a/solr/src/webapp/web/admin/analysis.jsp b/solr/src/webapp/web/admin/analysis.jsp index 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> atts = token.getAttributeClassesIterator(); while (atts.hasNext()) // make sure all att impls in the token exist here