lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From busc...@apache.org
Subject svn commit: r806444 - in /lucene/java/trunk/contrib: CHANGES.txt memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java
Date Fri, 21 Aug 2009 08:02:40 GMT
Author: buschmi
Date: Fri Aug 21 08:02:40 2009
New Revision: 806444

URL: http://svn.apache.org/viewvc?rev=806444&view=rev
Log:
LUCENE-1828: Fix MemoryIndex to call TokenStream.reset() and TokenStream.end().

Modified:
    lucene/java/trunk/contrib/CHANGES.txt
    lucene/java/trunk/contrib/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java

Modified: lucene/java/trunk/contrib/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/CHANGES.txt?rev=806444&r1=806443&r2=806444&view=diff
==============================================================================
--- lucene/java/trunk/contrib/CHANGES.txt (original)
+++ lucene/java/trunk/contrib/CHANGES.txt Fri Aug 21 08:02:40 2009
@@ -78,6 +78,8 @@
 10. LUCENE-1792: Fix new query parser to set rewrite method for
     multi-term queries. (Luis Alves, Mike McCandless via Michael Busch)
 
+11. LUCENE-1828: Fix memory index to call TokenStream.reset() and
+    TokenStream.end(). (Tim Smith via Michael Busch)
 
 New features
 

Modified: lucene/java/trunk/contrib/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java?rev=806444&r1=806443&r2=806444&view=diff
==============================================================================
--- lucene/java/trunk/contrib/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java
(original)
+++ lucene/java/trunk/contrib/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java
Fri Aug 21 08:02:40 2009
@@ -342,6 +342,7 @@
       PositionIncrementAttribute posIncrAttribute = (PositionIncrementAttribute) stream.addAttribute(PositionIncrementAttribute.class);
       OffsetAttribute offsetAtt = (OffsetAttribute) stream.addAttribute(OffsetAttribute.class);
       
+      stream.reset();
       while (stream.incrementToken()) {
         String term = termAtt.term();
         if (term.length() == 0) continue; // nothing to do
@@ -363,7 +364,8 @@
           positions.add(pos, offsetAtt.startOffset(), offsetAtt.endOffset());
         }
       }
-      
+      stream.end();
+
       // ensure infos.numTokens > 0 invariant; needed for correct operation of terms()
       if (numTokens > 0) {
         boost = boost * docBoost; // see DocumentWriter.addDocument(...)



Mime
View raw message