lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ka...@apache.org
Subject svn commit: r725837 - in /lucene/java/trunk/contrib: ./ instantiated/src/java/org/apache/lucene/store/instantiated/
Date Thu, 11 Dec 2008 22:08:46 GMT
Author: kalle
Date: Thu Dec 11 14:08:45 2008
New Revision: 725837

URL: http://svn.apache.org/viewvc?rev=725837&view=rev
Log:
LUCENE-1462
InstantiatedIndexWriter did not reset pre analyzed TokenStreams the same way IndexWriter does.

Parts of InstantiatedIndex was not Serializable.


Modified:
    lucene/java/trunk/contrib/CHANGES.txt
    lucene/java/trunk/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/FieldSetting.java
    lucene/java/trunk/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/FieldSettings.java
    lucene/java/trunk/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedIndexWriter.java

Modified: lucene/java/trunk/contrib/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/CHANGES.txt?rev=725837&r1=725836&r2=725837&view=diff
==============================================================================
--- lucene/java/trunk/contrib/CHANGES.txt (original)
+++ lucene/java/trunk/contrib/CHANGES.txt Thu Dec 11 14:08:45 2008
@@ -15,6 +15,10 @@
  1. LUCENE-1423: InstantiatedTermEnum#skipTo(Term) throws ArrayIndexOutOfBounds on empty
index.
     (Karl Wettin) 
 
+ 2. LUCENE-1462: InstantiatedIndexWriter did not reset pre analyzed TokenStreams the
+    same way IndexWriter does. Parts of InstantiatedIndex was not Serializable.
+    (Karl Wettin)
+
 New features
 
  1. LUCENE-1470: Added TrieRangeQuery, a much faster implementation of

Modified: lucene/java/trunk/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/FieldSetting.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/FieldSetting.java?rev=725837&r1=725836&r2=725837&view=diff
==============================================================================
--- lucene/java/trunk/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/FieldSetting.java
(original)
+++ lucene/java/trunk/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/FieldSetting.java
Thu Dec 11 14:08:45 2008
@@ -1,5 +1,7 @@
 package org.apache.lucene.store.instantiated;
 
+import java.io.Serializable;
+
 /**
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -20,7 +22,7 @@
 /**
  * For non package access see {@link org.apache.lucene.index.IndexReader#getFieldNames(org.apache.lucene.index.IndexReader.FieldOption)}

  */
-class FieldSetting {
+class FieldSetting implements Serializable {
   String fieldName;
 
   boolean storeTermVector = false;

Modified: lucene/java/trunk/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/FieldSettings.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/FieldSettings.java?rev=725837&r1=725836&r2=725837&view=diff
==============================================================================
--- lucene/java/trunk/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/FieldSettings.java
(original)
+++ lucene/java/trunk/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/FieldSettings.java
Thu Dec 11 14:08:45 2008
@@ -3,6 +3,7 @@
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Collection;
+import java.io.Serializable;
 
 /**
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -24,7 +25,7 @@
 /**
  * Essetially a Map<FieldName, {@link org.apache.lucene.store.instantiated.FieldSetting}>

  */
-class FieldSettings {
+class FieldSettings implements Serializable {
 
 
   FieldSettings() {

Modified: lucene/java/trunk/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedIndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedIndexWriter.java?rev=725837&r1=725836&r2=725837&view=diff
==============================================================================
--- lucene/java/trunk/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedIndexWriter.java
(original)
+++ lucene/java/trunk/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedIndexWriter.java
Thu Dec 11 14:08:45 2008
@@ -522,6 +522,9 @@
             tokenStream = analyzer.tokenStream(field.name(), new StringReader(field.stringValue()));
           }
 
+          // reset the TokenStream to the first token          
+          tokenStream.reset();
+
           final Token reusableToken = new Token();
           for (Token nextToken = tokenStream.next(reusableToken); nextToken != null; nextToken
= tokenStream.next(reusableToken)) {
             tokens.add((Token) nextToken.clone()); // the vector will be built on commit.



Mime
View raw message