Author: michiel
Date: 2009-06-03 20:14:50 +0200 (Wed, 03 Jun 2009)
New Revision: 35644

Modified:
   mmbase/trunk/contributions/lucene/src/org/mmbase/module/lucene/Indexer.java
Log:
commit and close the writer before copying

Modified: 
mmbase/trunk/contributions/lucene/src/org/mmbase/module/lucene/Indexer.java
===================================================================
--- mmbase/trunk/contributions/lucene/src/org/mmbase/module/lucene/Indexer.java 
2009-06-03 17:38:28 UTC (rev 35643)
+++ mmbase/trunk/contributions/lucene/src/org/mmbase/module/lucene/Indexer.java 
2009-06-03 18:14:50 UTC (rev 35644)
@@ -58,7 +58,7 @@
      * @since MMBase-1.9
      */
     public static void addField(Document document, Field field, Multiple 
multiple) {
-        if (multiple == null) { 
+        if (multiple == null) {
           multiple = Multiple.ADD;
         }
         switch(multiple) {
@@ -481,12 +481,15 @@
                         }
                     }
                     writer.optimize();
+                    writer.commit();
+                    writer.close();
                     if (errorCountBefore == errorCount) {
                         // first clean up, to remove possible mess
                         clear(false);
-                        
                         Directory.copy(fullIndex, getDirectory(), true);
                         Date lastFullIndex = setLastFullIndex(startTime);
+                        log.info("Full index finished at " + lastFullIndex + 
". Copied " + fullIndex + " to " +
+                                getDirectory() + " Total nr documents in index 
'" + getName() + "': " + writer.maxDoc());
                         log.info("Full index finished at " + lastFullIndex );
                         if (log.isDebugEnabled()) log.debug("Copied " + 
fullIndex);
                         if (log.isDebugEnabled()) log.debug("    To " + 
getDirectory());

_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to