Search in sources :

Example 11 with QueryIndexProvider

use of org.apache.jackrabbit.oak.spi.query.QueryIndexProvider in project jackrabbit-oak by apache.

the class AtomicCounterIT method setup.

@Before
public void setup() throws Exception {
    DocumentNodeStore ns = builderProvider.newBuilder().getNodeStore();
    NodeBuilder builder = ns.getRoot().builder();
    NodeBuilder index = builder.child(INDEX_DEFINITIONS_NAME);
    NodeBuilder lucene = newLuceneIndexDefinition(index, "lucene", ImmutableSet.of("String"), null, "async");
    lucene.setProperty("async", of("async", "nrt"), STRINGS);
    IndexDefinition.updateDefinition(index.child("lucene"));
    ns.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
    LuceneIndexEditorProvider editorProvider = new LuceneIndexEditorProvider();
    editorProvider.setIndexingQueue(mock(DocumentQueue.class));
    LuceneIndexProvider provider = new LuceneIndexProvider();
    ContentRepository repository = new Oak(ns).with(// Clusterable
    ns).with(new OpenSecurityProvider()).with((QueryIndexProvider) provider).with((Observer) provider).with(editorProvider).with(executorService).withAtomicCounter().withAsyncIndexing("async", 1).withFailOnMissingIndexProvider().createContentRepository();
    session = repository.login(new SimpleCredentials("admin", "admin".toCharArray()), null);
    while (isReindexing(session)) {
        Thread.sleep(100);
    }
}
Also used : SimpleCredentials(javax.jcr.SimpleCredentials) LuceneIndexEditorProvider(org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditorProvider) ContentRepository(org.apache.jackrabbit.oak.api.ContentRepository) Oak(org.apache.jackrabbit.oak.Oak) DocumentNodeStore(org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore) DocumentQueue(org.apache.jackrabbit.oak.plugins.index.lucene.hybrid.DocumentQueue) OpenSecurityProvider(org.apache.jackrabbit.oak.spi.security.OpenSecurityProvider) LuceneIndexProvider(org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexProvider) NodeBuilder(org.apache.jackrabbit.oak.spi.state.NodeBuilder) QueryIndexProvider(org.apache.jackrabbit.oak.spi.query.QueryIndexProvider) Before(org.junit.Before)

Example 12 with QueryIndexProvider

use of org.apache.jackrabbit.oak.spi.query.QueryIndexProvider in project jackrabbit-oak by apache.

the class LuceneIndexAugmentTest method createRepository.

@Override
protected ContentRepository createRepository() {
    LuceneIndexEditorProvider editorProvider = new LuceneIndexEditorProvider(null, new ExtractedTextCache(0, 0), factory, Mounts.defaultMountInfoProvider());
    LuceneIndexProvider provider = new LuceneIndexProvider(tracker, ScorerProviderFactory.DEFAULT, factory);
    return new Oak().with(new OpenSecurityProvider()).with((QueryIndexProvider) provider).with((Observer) provider).with(editorProvider).createContentRepository();
}
Also used : Oak(org.apache.jackrabbit.oak.Oak) OpenSecurityProvider(org.apache.jackrabbit.oak.spi.security.OpenSecurityProvider) QueryIndexProvider(org.apache.jackrabbit.oak.spi.query.QueryIndexProvider)

Example 13 with QueryIndexProvider

use of org.apache.jackrabbit.oak.spi.query.QueryIndexProvider in project jackrabbit-oak by apache.

the class LuceneOakRepositoryStub method preCreateRepository.

@Override
protected void preCreateRepository(Jcr jcr) {
    LuceneIndexProvider provider = new LuceneIndexProvider().with(getNodeAggregator());
    jcr.with(new LuceneCompatModeInitializer("luceneGlobal", (Set<String>) null)).with((QueryIndexProvider) provider).with((Observer) provider).withFastQueryResultSize(true).with(new LuceneIndexEditorProvider());
}
Also used : Set(java.util.Set) LuceneIndexEditorProvider(org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditorProvider) LuceneIndexProvider(org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexProvider) QueryIndexProvider(org.apache.jackrabbit.oak.spi.query.QueryIndexProvider)

Aggregations

QueryIndexProvider (org.apache.jackrabbit.oak.spi.query.QueryIndexProvider)13 Oak (org.apache.jackrabbit.oak.Oak)6 OpenSecurityProvider (org.apache.jackrabbit.oak.spi.security.OpenSecurityProvider)6 Observer (org.apache.jackrabbit.oak.spi.commit.Observer)5 SimpleCredentials (javax.jcr.SimpleCredentials)4 InitialContent (org.apache.jackrabbit.oak.InitialContent)4 Jcr (org.apache.jackrabbit.oak.jcr.Jcr)3 LuceneIndexEditorProvider (org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditorProvider)3 LuceneIndexProvider (org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexProvider)3 PropertyIndexEditorProvider (org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexEditorProvider)3 Before (org.junit.Before)3 ContentRepository (org.apache.jackrabbit.oak.api.ContentRepository)2 AsyncIndexUpdate (org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate)2 IndexEditorProvider (org.apache.jackrabbit.oak.plugins.index.IndexEditorProvider)2 NodeTypeIndexProvider (org.apache.jackrabbit.oak.plugins.index.nodetype.NodeTypeIndexProvider)2 MemoryNodeStore (org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore)2 CommitHook (org.apache.jackrabbit.oak.spi.commit.CommitHook)2 Lists.newArrayList (com.google.common.collect.Lists.newArrayList)1 File (java.io.File)1 IOException (java.io.IOException)1