clerezza-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject svn commit: r1500708 - /clerezza/trunk/rdf.cris/core/src/main/java/org/apache/clerezza/rdf/cris/GraphIndexer.java
Date Mon, 08 Jul 2013 13:07:32 GMT
Author: reto
Date: Mon Jul  8 13:07:31 2013
New Revision: 1500708

URL: http://svn.apache.org/r1500708
Log:
CLEREZZA-798: deleting exiting documents from index when recreating it.

Modified:
    clerezza/trunk/rdf.cris/core/src/main/java/org/apache/clerezza/rdf/cris/GraphIndexer.java

Modified: clerezza/trunk/rdf.cris/core/src/main/java/org/apache/clerezza/rdf/cris/GraphIndexer.java
URL: http://svn.apache.org/viewvc/clerezza/trunk/rdf.cris/core/src/main/java/org/apache/clerezza/rdf/cris/GraphIndexer.java?rev=1500708&r1=1500707&r2=1500708&view=diff
==============================================================================
--- clerezza/trunk/rdf.cris/core/src/main/java/org/apache/clerezza/rdf/cris/GraphIndexer.java
(original)
+++ clerezza/trunk/rdf.cris/core/src/main/java/org/apache/clerezza/rdf/cris/GraphIndexer.java
Mon Jul  8 13:07:31 2013
@@ -32,6 +32,7 @@ import java.util.Timer;
 import java.util.TimerTask;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
+import java.util.logging.Level;
 import org.apache.clerezza.rdf.core.NonLiteral;
 import org.apache.clerezza.rdf.core.Resource;
 import org.apache.clerezza.rdf.core.Triple;
@@ -587,6 +588,11 @@ public class GraphIndexer extends Resour
         }
         logger.debug("instances " + instances.size());
         IndexWriter writer = luceneTools.getIndexWriter(true);
+        try {
+            writer.deleteAll();
+        } catch (IOException ex) {
+            throw new RuntimeException(ex);
+        }
         for (NonLiteral instance : instances) {
             indexResource(instance, writer);
         }



Mime
View raw message