use of org.apache.jackrabbit.oak.plugins.index.elastic.query.ElasticIndexProvider in project jackrabbit-oak by apache.
the class ElasticFacetTest method createRepository.
private void createRepository() throws RepositoryException {
ElasticConnection connection = elasticRule.useDocker() ? elasticRule.getElasticConnectionForDocker() : elasticRule.getElasticConnectionFromString();
ElasticIndexTracker indexTracker = new ElasticIndexTracker(connection, new ElasticMetricHandler(StatisticsProvider.NOOP));
ElasticIndexEditorProvider editorProvider = new ElasticIndexEditorProvider(indexTracker, connection, new ExtractedTextCache(10 * FileUtils.ONE_MB, 100));
ElasticIndexProvider indexProvider = new ElasticIndexProvider(indexTracker);
NodeStore nodeStore = new MemoryNodeStore(INITIAL_CONTENT);
Oak oak = new Oak(nodeStore).with(editorProvider).with(indexTracker).with(indexProvider);
Jcr jcr = new Jcr(oak);
Repository repository = jcr.createRepository();
adminSession = repository.login(new SimpleCredentials("admin", "admin".toCharArray()), null);
// we'd always query anonymously
anonymousSession = repository.login(new GuestCredentials(), null);
anonymousSession.refresh(true);
anonymousSession.save();
qe = anonymousSession.getWorkspace().getQueryManager();
}
use of org.apache.jackrabbit.oak.plugins.index.elastic.query.ElasticIndexProvider in project jackrabbit-oak by apache.
the class ElasticReindexTest method createRepository.
private void createRepository() throws RepositoryException {
ElasticConnection connection = elasticRule.useDocker() ? elasticRule.getElasticConnectionForDocker() : elasticRule.getElasticConnectionFromString();
ElasticIndexTracker indexTracker = new ElasticIndexTracker(connection, new ElasticMetricHandler(StatisticsProvider.NOOP));
ElasticIndexEditorProvider editorProvider = new ElasticIndexEditorProvider(indexTracker, connection, new ExtractedTextCache(10 * FileUtils.ONE_MB, 100));
ElasticIndexProvider indexProvider = new ElasticIndexProvider(indexTracker);
NodeStore nodeStore = new MemoryNodeStore(INITIAL_CONTENT);
Oak oak = new Oak(nodeStore).with(new OpenSecurityProvider()).with(editorProvider).with(indexTracker).with(indexProvider).with(new PropertyIndexEditorProvider()).with(new NodeTypeIndexProvider());
Jcr jcr = new Jcr(oak);
Repository repository = jcr.createRepository();
adminSession = repository.login(new SimpleCredentials("admin", "admin".toCharArray()), null);
qe = adminSession.getWorkspace().getQueryManager();
}
use of org.apache.jackrabbit.oak.plugins.index.elastic.query.ElasticIndexProvider in project jackrabbit-oak by apache.
the class ElasticFacetSearchTest method createRepository.
@Override
protected Repository[] createRepository(RepositoryFixture fixture) throws Exception {
indexName = TestHelper.getUniqueIndexName("elasticFacetTest");
Map<String, Boolean> propMap = new LinkedHashMap<>();
propMap.put(SEARCH_PROP, false);
propMap.put(FACET_PROP_1, true);
propMap.put(FACET_PROP_2, true);
if (fixture instanceof OakRepositoryFixture) {
return ((OakRepositoryFixture) fixture).setUpCluster(1, oak -> {
ElasticIndexTracker indexTracker = new ElasticIndexTracker(connection, new ElasticMetricHandler(StatisticsProvider.NOOP));
ElasticIndexEditorProvider editorProvider = new ElasticIndexEditorProvider(indexTracker, connection, new ExtractedTextCache(10 * FileUtils.ONE_MB, 100));
ElasticIndexProvider indexProvider = new ElasticIndexProvider(indexTracker);
oak.with(editorProvider).with(indexTracker).with(indexProvider).with(new PropertyIndexEditorProvider()).with(new NodeTypeIndexProvider()).with(new FacetIndexInitializer(indexName, propMap, ElasticIndexDefinition.TYPE_ELASTICSEARCH, getFacetMode()));
return new Jcr(oak);
});
}
return super.createRepository(fixture);
}
use of org.apache.jackrabbit.oak.plugins.index.elastic.query.ElasticIndexProvider in project jackrabbit-oak by apache.
the class ElasticPropertyFTSeparatedIndexedContentAvailability method createRepository.
@Override
protected Repository[] createRepository(RepositoryFixture fixture) throws Exception {
elasticGlobalIndexName = TestHelper.getUniqueIndexName("elasticGlobal");
elasticTitleIndexName = TestHelper.getUniqueIndexName("elasticTitle");
if (fixture instanceof OakRepositoryFixture) {
currentFixtureName = fixture.toString();
return ((OakRepositoryFixture) fixture).setUpCluster(1, oak -> {
ElasticIndexTracker indexTracker = new ElasticIndexTracker(connection, new ElasticMetricHandler(StatisticsProvider.NOOP));
ElasticIndexEditorProvider editorProvider = new ElasticIndexEditorProvider(indexTracker, connection, new ExtractedTextCache(10 * FileUtils.ONE_MB, 100));
ElasticIndexProvider indexProvider = new ElasticIndexProvider(indexTracker);
oak.with(editorProvider).with(indexProvider).with(indexProvider).with((new ElasticGlobalInitializer(elasticGlobalIndexName, storageEnabled)).async("fulltext-async")).with(new FullTextPropertyInitialiser(elasticTitleIndexName, Collections.singleton("title"), ElasticIndexDefinition.TYPE_ELASTICSEARCH).async()).withAsyncIndexing("async", 5).withAsyncIndexing("fulltext-async", 5);
return new Jcr(oak);
});
}
return super.createRepository(fixture);
}
use of org.apache.jackrabbit.oak.plugins.index.elastic.query.ElasticIndexProvider in project jackrabbit-oak by apache.
the class ElasticPropertyTextSearchTest method createRepository.
@Override
protected Repository[] createRepository(RepositoryFixture fixture) throws Exception {
indexName = TestHelper.getUniqueIndexName("elasticTitle");
if (fixture instanceof OakRepositoryFixture) {
return ((OakRepositoryFixture) fixture).setUpCluster(1, oak -> {
ElasticIndexTracker indexTracker = new ElasticIndexTracker(connection, new ElasticMetricHandler(StatisticsProvider.NOOP));
ElasticIndexEditorProvider editorProvider = new ElasticIndexEditorProvider(indexTracker, connection, new ExtractedTextCache(10 * FileUtils.ONE_MB, 100));
ElasticIndexProvider indexProvider = new ElasticIndexProvider(indexTracker);
oak.with(editorProvider).with(indexProvider).with(indexProvider).with(new PropertyIndexEditorProvider()).with(new NodeTypeIndexProvider()).with(new PropertyFullTextTest.FullTextPropertyInitialiser(indexName, Collections.singleton("title"), ElasticIndexDefinition.TYPE_ELASTICSEARCH));
return new Jcr(oak);
});
}
return super.createRepository(fixture);
}
Aggregations