Search in sources :

Example 1 with LuceneSchemaIndexProvider

use of org.neo4j.kernel.api.impl.schema.LuceneSchemaIndexProvider in project neo4j by neo4j.

the class StoreMigratorFrom20IT method setUp.

@Before
public void setUp() {
    fs = fileSystemRule.get();
    pageCache = pageCacheRule.getPageCache(fs);
    File storeDirectory = storeDir.directory();
    schemaIndexProvider = new LuceneSchemaIndexProvider(fs, DirectoryFactory.PERSISTENT, storeDirectory, NullLogProvider.getInstance(), Config.empty(), OperationalMode.single);
    labelScanStoreProvider = NeoStoreDataSourceRule.nativeLabelScanStoreProvider(storeDirectory, fs, pageCache);
    upgradableDatabase = new UpgradableDatabase(fs, new StoreVersionCheck(pageCache), new LegacyStoreVersionCheck(fs), recordFormat);
}
Also used : LuceneSchemaIndexProvider(org.neo4j.kernel.api.impl.schema.LuceneSchemaIndexProvider) StoreVersionCheck(org.neo4j.kernel.impl.storemigration.StoreVersionCheck) LegacyStoreVersionCheck(org.neo4j.kernel.impl.storemigration.legacystore.LegacyStoreVersionCheck) UpgradableDatabase(org.neo4j.kernel.impl.storemigration.UpgradableDatabase) LegacyStoreVersionCheck(org.neo4j.kernel.impl.storemigration.legacystore.LegacyStoreVersionCheck) File(java.io.File) Before(org.junit.Before)

Example 2 with LuceneSchemaIndexProvider

use of org.neo4j.kernel.api.impl.schema.LuceneSchemaIndexProvider in project neo4j by neo4j.

the class NonUniqueIndexTests method nodeIdsInIndex.

private List<Long> nodeIdsInIndex(int indexId, String value) throws Exception {
    Config config = Config.empty();
    SchemaIndexProvider indexProvider = new LuceneSchemaIndexProvider(fileSystemRule.get(), DirectoryFactory.PERSISTENT, directory.graphDbDir(), NullLogProvider.getInstance(), Config.empty(), OperationalMode.single);
    IndexSamplingConfig samplingConfig = new IndexSamplingConfig(config);
    try (IndexAccessor accessor = indexProvider.getOnlineAccessor(indexId, NewIndexDescriptorFactory.forLabel(0, 0), samplingConfig);
        IndexReader reader = accessor.newReader()) {
        return PrimitiveLongCollections.asList(reader.query(IndexQuery.exact(1, value)));
    }
}
Also used : LuceneSchemaIndexProvider(org.neo4j.kernel.api.impl.schema.LuceneSchemaIndexProvider) IndexSamplingConfig(org.neo4j.kernel.impl.api.index.sampling.IndexSamplingConfig) LuceneSchemaIndexProvider(org.neo4j.kernel.api.impl.schema.LuceneSchemaIndexProvider) SchemaIndexProvider(org.neo4j.kernel.api.index.SchemaIndexProvider) Config(org.neo4j.kernel.configuration.Config) IndexSamplingConfig(org.neo4j.kernel.impl.api.index.sampling.IndexSamplingConfig) IndexAccessor(org.neo4j.kernel.api.index.IndexAccessor) IndexReader(org.neo4j.storageengine.api.schema.IndexReader)

Aggregations

LuceneSchemaIndexProvider (org.neo4j.kernel.api.impl.schema.LuceneSchemaIndexProvider)2 File (java.io.File)1 Before (org.junit.Before)1 IndexAccessor (org.neo4j.kernel.api.index.IndexAccessor)1 SchemaIndexProvider (org.neo4j.kernel.api.index.SchemaIndexProvider)1 Config (org.neo4j.kernel.configuration.Config)1 IndexSamplingConfig (org.neo4j.kernel.impl.api.index.sampling.IndexSamplingConfig)1 StoreVersionCheck (org.neo4j.kernel.impl.storemigration.StoreVersionCheck)1 UpgradableDatabase (org.neo4j.kernel.impl.storemigration.UpgradableDatabase)1 LegacyStoreVersionCheck (org.neo4j.kernel.impl.storemigration.legacystore.LegacyStoreVersionCheck)1 IndexReader (org.neo4j.storageengine.api.schema.IndexReader)1