use of org.apache.jackrabbit.oak.plugins.index.solr.index.SolrIndexEditorProvider in project jackrabbit-oak by apache.
the class SubtreeSolrIndexIT method createRepository.
@Override
protected ContentRepository createRepository() {
try {
DefaultSolrServerProvider solrServerProvider = new DefaultSolrServerProvider();
DefaultSolrConfigurationProvider oakSolrConfigurationProvider = new DefaultSolrConfigurationProvider();
return new Oak().with(new InitialContent()).with(new OpenSecurityProvider()).with(new SolrQueryIndexProvider(solrServerProvider, oakSolrConfigurationProvider)).with(new SolrIndexEditorProvider(solrServerProvider, oakSolrConfigurationProvider)).createContentRepository();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
use of org.apache.jackrabbit.oak.plugins.index.solr.index.SolrIndexEditorProvider in project jackrabbit-oak by apache.
the class SolrIndexIT method createRepository.
@Override
protected ContentRepository createRepository() {
try {
DefaultSolrServerProvider solrServerProvider = new DefaultSolrServerProvider();
DefaultSolrConfigurationProvider oakSolrConfigurationProvider = new DefaultSolrConfigurationProvider();
return new Oak().with(new InitialContent()).with(new OpenSecurityProvider()).with(new SolrQueryIndexProvider(solrServerProvider, oakSolrConfigurationProvider)).with(new SolrIndexEditorProvider(solrServerProvider, oakSolrConfigurationProvider)).createContentRepository();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
use of org.apache.jackrabbit.oak.plugins.index.solr.index.SolrIndexEditorProvider in project jackrabbit-oak by apache.
the class SolrOakRepositoryStub method preCreateRepository.
@Override
protected void preCreateRepository(Jcr jcr) {
String path = getClass().getResource("/").getFile() + "/queryjcrtest";
File f = new File(path);
final SolrServer solrServer;
try {
solrServer = new EmbeddedSolrServerProvider(new EmbeddedSolrServerConfiguration(f.getPath(), "oak")).getSolrServer();
} catch (Exception e) {
throw new RuntimeException();
}
SolrServerProvider solrServerProvider = new SolrServerProvider() {
@Override
public void close() throws IOException {
}
@CheckForNull
@Override
public SolrServer getSolrServer() throws Exception {
return solrServer;
}
@Override
public SolrServer getIndexingSolrServer() throws Exception {
return solrServer;
}
@Override
public SolrServer getSearchingSolrServer() throws Exception {
return solrServer;
}
};
try {
// safely remove any previous document on the index
solrServer.deleteByQuery("*:*");
solrServer.commit();
} catch (Exception e) {
throw new RuntimeException(e);
}
OakSolrConfiguration configuration = new DefaultSolrConfiguration() {
@Nonnull
@Override
public CommitPolicy getCommitPolicy() {
return CommitPolicy.HARD;
}
};
OakSolrConfigurationProvider oakSolrConfigurationProvider = new DefaultSolrConfigurationProvider(configuration);
jcr.with(new SolrIndexInitializer(false)).with(AggregateIndexProvider.wrap(new SolrQueryIndexProvider(solrServerProvider, oakSolrConfigurationProvider))).with(new NodeStateSolrServersObserver()).with(new SolrIndexEditorProvider(solrServerProvider, oakSolrConfigurationProvider));
}
use of org.apache.jackrabbit.oak.plugins.index.solr.index.SolrIndexEditorProvider in project jackrabbit-oak by apache.
the class SolrBaseTest method setUp.
@Before
public void setUp() throws Exception {
store = SegmentNodeStoreBuilders.builder(new MemoryStore()).build();
provider = new TestUtils();
server = provider.getSolrServer();
configuration = provider.getConfiguration();
hook = new EditorHook(new IndexUpdateProvider(new SolrIndexEditorProvider(provider, provider)));
Oak oak = new Oak().with(new InitialContent()).with(new OpenSecurityProvider()).with(// synchronous
new SolrIndexInitializer(false)).with(new SolrQueryIndexProvider(provider, provider)).with(new NodeStateSolrServersObserver()).with(new SolrIndexEditorProvider(provider, provider));
repository = oak.createContentRepository();
}
Aggregations