Search in sources :

Example 1 with RAMDirectoryManager

use of org.apache.jackrabbit.core.query.lucene.directory.RAMDirectoryManager in project jackrabbit by apache.

the class IndexMigrationTest method testMigration.

public void testMigration() throws Exception {
    List<Document> docs = new ArrayList<Document>();
    docs.add(createDocument("ab", "a"));
    docs.add(createDocument("a", "b"));
    docs.add(createDocument("abcd", "c"));
    docs.add(createDocument("abc", "d"));
    DirectoryManager dirMgr = new RAMDirectoryManager();
    PersistentIndex idx = new PersistentIndex("index", new StandardAnalyzer(Version.LUCENE_36), Similarity.getDefault(), new DocNumberCache(100), new IndexingQueue(new IndexingQueueStore(new RAMDirectory())), dirMgr, 0);
    idx.addDocuments(docs.toArray(new Document[docs.size()]));
    idx.commit();
    IndexMigration.migrate(idx, dirMgr, SEP_CHAR);
}
Also used : RAMDirectoryManager(org.apache.jackrabbit.core.query.lucene.directory.RAMDirectoryManager) StandardAnalyzer(org.apache.lucene.analysis.standard.StandardAnalyzer) ArrayList(java.util.ArrayList) DirectoryManager(org.apache.jackrabbit.core.query.lucene.directory.DirectoryManager) RAMDirectoryManager(org.apache.jackrabbit.core.query.lucene.directory.RAMDirectoryManager) Document(org.apache.lucene.document.Document) RAMDirectory(org.apache.lucene.store.RAMDirectory)

Aggregations

ArrayList (java.util.ArrayList)1 DirectoryManager (org.apache.jackrabbit.core.query.lucene.directory.DirectoryManager)1 RAMDirectoryManager (org.apache.jackrabbit.core.query.lucene.directory.RAMDirectoryManager)1 StandardAnalyzer (org.apache.lucene.analysis.standard.StandardAnalyzer)1 Document (org.apache.lucene.document.Document)1 RAMDirectory (org.apache.lucene.store.RAMDirectory)1