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
This commit is contained in:
Uwe Schindler 2011-04-20 21:35:05 +00:00
parent affaa37983
commit 20f261ca14
3 changed files with 6 additions and 0 deletions

View File

@ -291,6 +291,10 @@ Bug Fixes
* SOLR-2390: Performance of usePhraseHighlighter is terrible on very large Documents, * SOLR-2390: Performance of usePhraseHighlighter is terrible on very large Documents,
regardless of hl.maxDocCharsToAnalyze. (Mark Miller) 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 Other Changes
---------------------- ----------------------

View File

@ -337,6 +337,7 @@ public abstract class AnalysisRequestHandlerBase extends RequestHandlerBase {
@Override @Override
public boolean incrementToken() throws IOException { public boolean incrementToken() throws IOException {
if (tokenIterator.hasNext()) { if (tokenIterator.hasNext()) {
clearAttributes();
AttributeSource next = tokenIterator.next(); AttributeSource next = tokenIterator.next();
Iterator<Class<? extends Attribute>> atts = next.getAttributeClassesIterator(); Iterator<Class<? extends Attribute>> atts = next.getAttributeClassesIterator();
while (atts.hasNext()) // make sure all att impls in the token exist here while (atts.hasNext()) // make sure all att impls in the token exist here

View File

@ -222,6 +222,7 @@
public boolean incrementToken() throws IOException { public boolean incrementToken() throws IOException {
if (iter.hasNext()) { if (iter.hasNext()) {
clearAttributes();
AttributeSource token = iter.next(); AttributeSource token = iter.next();
Iterator<Class<? extends Attribute>> atts = token.getAttributeClassesIterator(); Iterator<Class<? extends Attribute>> atts = token.getAttributeClassesIterator();
while (atts.hasNext()) // make sure all att impls in the token exist here while (atts.hasNext()) // make sure all att impls in the token exist here