mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-09-17 14:21:39 +00:00
Initialise empty index early
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5004 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -351,6 +351,27 @@ public class IndexInfo
|
|||||||
super();
|
super();
|
||||||
initialiseTransitions();
|
initialiseTransitions();
|
||||||
|
|
||||||
|
|
||||||
|
// Create an empty in memory index
|
||||||
|
IndexWriter writer;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
writer = new IndexWriter(emptyIndex, new AlfrescoStandardAnalyser(), true);
|
||||||
|
writer.setUseCompoundFile(writerUseCompoundFile);
|
||||||
|
writer.setMaxBufferedDocs(writerMinMergeDocs);
|
||||||
|
writer.setMergeFactor(writerMergeFactor);
|
||||||
|
writer.setMaxMergeDocs(writerMaxMergeDocs);
|
||||||
|
writer.setCommitLockTimeout(commitLockTimeout);
|
||||||
|
writer.setWriteLockTimeout(writeLockTimeout);
|
||||||
|
writer.setMaxFieldLength(maxFieldLength);
|
||||||
|
writer.setTermIndexInterval(termIndexInterval);
|
||||||
|
writer.close();
|
||||||
|
}
|
||||||
|
catch (IOException e)
|
||||||
|
{
|
||||||
|
throw new IndexerException("Failed to create an empty in memory index!");
|
||||||
|
}
|
||||||
|
|
||||||
this.indexDirectory = indexDirectory;
|
this.indexDirectory = indexDirectory;
|
||||||
|
|
||||||
// Make sure the directory exists
|
// Make sure the directory exists
|
||||||
@@ -557,25 +578,7 @@ public class IndexInfo
|
|||||||
mergerThread.start();
|
mergerThread.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create an empty in memory index
|
|
||||||
IndexWriter writer;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
writer = new IndexWriter(emptyIndex, new AlfrescoStandardAnalyser(), true);
|
|
||||||
writer.setUseCompoundFile(writerUseCompoundFile);
|
|
||||||
writer.setMaxBufferedDocs(writerMinMergeDocs);
|
|
||||||
writer.setMergeFactor(writerMergeFactor);
|
|
||||||
writer.setMaxMergeDocs(writerMaxMergeDocs);
|
|
||||||
writer.setCommitLockTimeout(commitLockTimeout);
|
|
||||||
writer.setWriteLockTimeout(writeLockTimeout);
|
|
||||||
writer.setMaxFieldLength(maxFieldLength);
|
|
||||||
writer.setTermIndexInterval(termIndexInterval);
|
|
||||||
writer.close();
|
|
||||||
}
|
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
throw new IndexerException("Failed to create an empty in memory index!");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user