[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdesupport/strigi/src/luceneindexer
From:       Jos van den Oever <jos () vandenoever ! info>
Date:       2009-01-21 10:27:18
Message-ID: 1232533638.677565.20204.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 914510 by vandenoever:

Do not recreate index in RAMDirectory every time.

When opening an index in CLucene you have to watch out not to overwrite
an existing index. This was handled correctly for normal files, but not
for an in-memory index. The changed code checks whether there is an
index already and does not overwrite it.

 M  +2 -1      cluceneindexmanager.cpp  


--- trunk/kdesupport/strigi/src/luceneindexer/cluceneindexmanager.cpp #914509:914510
@@ -127,7 +127,8 @@
 CLuceneIndexManager::openWriter(bool truncate) {
     try {
         if (ramdirectory) {
-            indexwriter = new IndexWriter(ramdirectory, analyzer, true);
+            indexwriter = new IndexWriter(ramdirectory, analyzer,
+                !IndexReader::indexExists(ramdirectory));
         } else if (!truncate && IndexReader::indexExists(dbdir.c_str())) {
             if (IndexReader::isLocked(dbdir.c_str())) {
                 IndexReader::unlock(dbdir.c_str());
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic