From 20f261ca14d2b14c1b6c99b115f1c833c9331035 Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Wed, 20 Apr 2011 21:35:05 +0000 Subject: [PATCH] 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 git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1095521 13f79535-47bb-0310-9956-ffa450edef68 --- solr/CHANGES.txt | 4 ++++ .../org/apache/solr/handler/AnalysisRequestHandlerBase.java | 1 + solr/src/webapp/web/admin/analysis.jsp | 1 + 3 files changed, 6 insertions(+) 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