From d76776eb1bdb204a0e8ccbb4f170bdaba26c5a28 Mon Sep 17 00:00:00 2001 From: Grant Ingersoll Date: Tue, 21 Oct 2008 15:50:03 +0000 Subject: [PATCH] SOLR-532: WordDelimFilter respects payloads and other Token attributes git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@706667 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 2 ++ src/java/org/apache/solr/analysis/WordDelimiterFilter.java | 6 +----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 2876593c000..a136acc48db 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -84,6 +84,8 @@ Bug Fixes 2. SOLR-771: CoreAdminHandler STATUS should display 'normalized' paths (koji, hossman, shalin) + 3. SOLR-532: WordDelimiterFilter now respects payloads and other attributes of the original Token by using Token.clone() (Tricia Williams, gsingers) + Other Changes ---------------------- diff --git a/src/java/org/apache/solr/analysis/WordDelimiterFilter.java b/src/java/org/apache/solr/analysis/WordDelimiterFilter.java index 8561e667bc0..8913a51127e 100644 --- a/src/java/org/apache/solr/analysis/WordDelimiterFilter.java +++ b/src/java/org/apache/solr/analysis/WordDelimiterFilter.java @@ -236,11 +236,7 @@ final class WordDelimiterFilter extends TokenFilter { startOff += start; } - Token newTok = new Token(startOff, - endOff, - orig.type()); - newTok.setTermBuffer(orig.termBuffer(), start, (end - start)); - return newTok; + return (Token)orig.clone(orig.termBuffer(), start, (end - start), startOff, endOff); }