Search in sources :

Example 1 with FSDirectoryFactory

use of org.apache.jackrabbit.oak.plugins.index.lucene.directory.FSDirectoryFactory in project jackrabbit-oak by apache.

the class DefaultIndexWriterTest method indexWriterConfig_Scheduler_Local.

@Test
public void indexWriterConfig_Scheduler_Local() throws Exception {
    FSDirectoryFactory fsdir = new FSDirectoryFactory(folder.getRoot());
    IndexDefinition defn = new IndexDefinition(root, builder.getNodeState(), "/foo");
    DefaultIndexWriter writer = new DefaultIndexWriter(defn, builder, fsdir, INDEX_DATA_CHILD_NAME, SUGGEST_DATA_CHILD_NAME, true, writerConfig);
    IndexWriter w = writer.getWriter();
    assertThat(w.getConfig().getMergeScheduler(), instanceOf(ConcurrentMergeScheduler.class));
}
Also used : IndexDefinition(org.apache.jackrabbit.oak.plugins.index.lucene.IndexDefinition) IndexWriter(org.apache.lucene.index.IndexWriter) ConcurrentMergeScheduler(org.apache.lucene.index.ConcurrentMergeScheduler) FSDirectoryFactory(org.apache.jackrabbit.oak.plugins.index.lucene.directory.FSDirectoryFactory) Test(org.junit.Test)

Example 2 with FSDirectoryFactory

use of org.apache.jackrabbit.oak.plugins.index.lucene.directory.FSDirectoryFactory in project jackrabbit-oak by apache.

the class OutOfBandIndexer method createLuceneEditorProvider.

private IndexEditorProvider createLuceneEditorProvider() throws IOException {
    LuceneIndexHelper luceneIndexHelper = indexHelper.getLuceneIndexHelper();
    DirectoryFactory dirFactory = new FSDirectoryFactory(getLocalIndexDir());
    luceneIndexHelper.setDirectoryFactory(dirFactory);
    LuceneIndexEditorProvider provider = luceneIndexHelper.createEditorProvider();
    provider.setWriterConfig(luceneIndexHelper.getWriterConfigForReindex());
    return provider;
}
Also used : LuceneIndexEditorProvider(org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditorProvider) FSDirectoryFactory(org.apache.jackrabbit.oak.plugins.index.lucene.directory.FSDirectoryFactory) DirectoryFactory(org.apache.jackrabbit.oak.plugins.index.lucene.directory.DirectoryFactory) FSDirectoryFactory(org.apache.jackrabbit.oak.plugins.index.lucene.directory.FSDirectoryFactory)

Aggregations

FSDirectoryFactory (org.apache.jackrabbit.oak.plugins.index.lucene.directory.FSDirectoryFactory)2 IndexDefinition (org.apache.jackrabbit.oak.plugins.index.lucene.IndexDefinition)1 LuceneIndexEditorProvider (org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditorProvider)1 DirectoryFactory (org.apache.jackrabbit.oak.plugins.index.lucene.directory.DirectoryFactory)1 ConcurrentMergeScheduler (org.apache.lucene.index.ConcurrentMergeScheduler)1 IndexWriter (org.apache.lucene.index.IndexWriter)1 Test (org.junit.Test)1