Search in sources :

Example 26 with IndexDefinition

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

the class NRTIndexFactoryTest method noIndexForAsync.

@Test
public void noIndexForAsync() throws Exception {
    IndexDefinition idxDefn = new IndexDefinition(root, builder.getNodeState(), "/foo");
    assertNull(indexFactory.createIndex(idxDefn));
}
Also used : IndexDefinition(org.apache.jackrabbit.oak.plugins.index.lucene.IndexDefinition) Test(org.junit.Test)

Example 27 with IndexDefinition

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

the class NRTIndexFactoryTest method indexCreationSync.

@Test
public void indexCreationSync() throws Exception {
    IndexDefinition idxDefn = getNRTIndexDefinition("/foo");
    NRTIndex idx1 = indexFactory.createIndex(idxDefn);
    assertNotNull(idx1);
    assertEquals(1, indexFactory.getIndexes("/foo").size());
}
Also used : IndexDefinition(org.apache.jackrabbit.oak.plugins.index.lucene.IndexDefinition) Test(org.junit.Test)

Example 28 with IndexDefinition

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

the class DefaultIndexWriterTest method lazyInit.

@Test
public void lazyInit() throws Exception {
    IndexDefinition defn = new IndexDefinition(root, builder.getNodeState(), "/foo");
    DefaultIndexWriter writer = new DefaultIndexWriter(defn, builder, null, INDEX_DATA_CHILD_NAME, SUGGEST_DATA_CHILD_NAME, false);
    assertFalse(writer.close(0));
}
Also used : IndexDefinition(org.apache.jackrabbit.oak.plugins.index.lucene.IndexDefinition) Test(org.junit.Test)

Aggregations

IndexDefinition (org.apache.jackrabbit.oak.plugins.index.lucene.IndexDefinition)28 Test (org.junit.Test)24 LuceneIndexWriter (org.apache.jackrabbit.oak.plugins.index.lucene.writer.LuceneIndexWriter)7 NodeState (org.apache.jackrabbit.oak.spi.state.NodeState)7 Document (org.apache.lucene.document.Document)7 Directory (org.apache.lucene.store.Directory)7 NodeBuilder (org.apache.jackrabbit.oak.spi.state.NodeBuilder)5 File (java.io.File)4 OakDirectory (org.apache.jackrabbit.oak.plugins.index.lucene.OakDirectory)4 Result (org.apache.jackrabbit.oak.plugins.index.lucene.directory.IndexConsistencyChecker.Result)3 LuceneIndexReader (org.apache.jackrabbit.oak.plugins.index.lucene.reader.LuceneIndexReader)3 DefaultDirectoryFactory (org.apache.jackrabbit.oak.plugins.index.lucene.directory.DefaultDirectoryFactory)2 DefaultIndexWriterFactory (org.apache.jackrabbit.oak.plugins.index.lucene.writer.DefaultIndexWriterFactory)2 LuceneIndexWriterFactory (org.apache.jackrabbit.oak.plugins.index.lucene.writer.LuceneIndexWriterFactory)2 StringField (org.apache.lucene.document.StringField)2 FSDirectory (org.apache.lucene.store.FSDirectory)2 Closer (com.google.common.io.Closer)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 IOException (java.io.IOException)1 Blob (org.apache.jackrabbit.oak.api.Blob)1