Index: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/directory/FSDirectoryManager.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/directory/FSDirectoryManager.java	(revision 1721612)
+++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/directory/FSDirectoryManager.java	(revision )
@@ -134,7 +134,7 @@
 
     //-----------------------< internal >---------------------------------------
 
-    private static final class FSDir extends Directory {
+    public static final class FSDir extends Directory {
 
         private static final FileFilter FILTER = new FileFilter() {
             public boolean accept(File pathname) {
@@ -156,6 +156,10 @@
             } else {
                 directory = FSDirectory.open(dir, lockFactory);
             }
+        }
+
+        public FSDirectory getFSDirectory() {
+            return directory;
         }
 
         @Override
Index: jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/IndexInfosTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/IndexInfosTest.java	(revision 1721612)
+++ jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/IndexInfosTest.java	(revision )
@@ -52,7 +52,7 @@
 
     public void testEmptyIndexesFile() throws IOException {
         // creates initial generation of infos
-        IndexInfos infos = new IndexInfos(dir, "indexes");
+        IndexInfos infos = new IndexInfos(dir, "indexes", null);
         long initialGeneration = infos.getGeneration();
 
         // create second generation
@@ -67,7 +67,7 @@
         new IndexHistory(dir, Integer.MAX_VALUE); // must succeed
 
         // read index infos again
-        infos = new IndexInfos(dir, "indexes");
+        infos = new IndexInfos(dir, "indexes", null);
         assertEquals("must read initial generation", initialGeneration, infos.getGeneration());
 
         // create new generation
Index: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java	(revision 1721612)
+++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java	(revision )
@@ -250,7 +250,7 @@
         this.excludedIDs = new HashSet<NodeId>(excludedIDs);
         this.nsMappings = handler.getNamespaceMappings();
 
-        indexNames = new IndexInfos(indexDir, "indexes");
+        indexNames = new IndexInfos(indexDir, "indexes", directoryManager);
 
         this.indexHistory = new IndexHistory(indexDir,
                 handler.getMaxHistoryAge() * 1000);
Index: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexInfos.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexInfos.java	(revision 1721612)
+++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexInfos.java	(revision )
@@ -33,6 +33,7 @@
 import java.util.Map;
 import java.util.NoSuchElementException;
 
+import org.apache.jackrabbit.core.query.lucene.directory.DirectoryManager;
 import org.apache.jackrabbit.core.query.lucene.directory.IndexInputStream;
 import org.apache.jackrabbit.core.query.lucene.directory.IndexOutputStream;
 import org.apache.lucene.store.Directory;
@@ -98,11 +99,16 @@
      * @throws IOException if an error occurs while reading the index infos
      * file.
      */
-    IndexInfos(Directory dir, String baseName) throws IOException {
+    IndexInfos(Directory dir, String baseName, final DirectoryManager directoryManager) throws IOException {
         this.directory = dir;
         this.name = baseName;
         long gens[] = getGenerations(getFileNames(dir, baseName), baseName);
         if (gens.length == 0) {
+            if (directoryManager != null) {
+                for (String existingIndexName : directoryManager.getDirectoryNames()) {
+                    indexes.put(existingIndexName, new IndexInfo(existingIndexName, 0));
+                }
+            }
             // write initial infos
             write();
         } else {
