Index: oak-run/pom.xml =================================================================== --- oak-run/pom.xml (revision 1592468) +++ oak-run/pom.xml (working copy) @@ -144,6 +144,11 @@ org.apache.jackrabbit + oak-solr-core + ${project.version} + + + org.apache.jackrabbit oak-mk-remote ${project.version} @@ -157,6 +162,11 @@ mongo-java-driver + org.apache.solr + solr-solrj + ${lucene.version} + + org.apache.jackrabbit jackrabbit-jcr-server ${jackrabbit.version} @@ -249,7 +259,7 @@ them in maven-shade-plugin. Otherwise it causes duplicate classes warning --> - org.apache.lucene:* + org.apache.lucene:lucene-core:3.6.0 - - org.apache.lucene - lucene-core - ${lucene.version} - - - org.apache.lucene - lucene-analyzers-common - ${lucene.version} - - - org.apache.lucene - lucene-queryparser - ${lucene.version} - - - org.apache.lucene - lucene-queries - ${lucene.version} - + + org.apache.lucene + lucene-suggest + ${lucene.version} + + + org.apache.lucene + lucene-core + ${lucene.version} + + + org.apache.lucene + lucene-analyzers-common + ${lucene.version} + + + org.apache.lucene + lucene-queryparser + ${lucene.version} + + + org.apache.lucene + lucene-queries + ${lucene.version} + + + + org.apache.solr + solr-core + ${lucene.version} + + Index: oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/BenchmarkRunner.java =================================================================== --- oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/BenchmarkRunner.java (revision 1592468) +++ oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/BenchmarkRunner.java (working copy) @@ -220,6 +220,10 @@ new FullTextSearchTest( wikipedia.value(options), flatStructure.value(options), + report.value(options), withStorage.value(options)), + new FullTextSolrSearchTest( + wikipedia.value(options), + flatStructure.value(options), report.value(options), withStorage.value(options)) }; Index: oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/FullTextSearchTest.java =================================================================== --- oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/FullTextSearchTest.java (revision 1592468) +++ oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/FullTextSearchTest.java (working copy) @@ -73,7 +73,7 @@ /** * null means true; true means true */ - private Boolean storageEnabled; + protected Boolean storageEnabled; public FullTextSearchTest(File dump, boolean flat, boolean doReport, Boolean storageEnabled) { this.importer = new WikipediaImport(dump, flat, doReport) { Index: oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/FullTextSolrSearchTest.java =================================================================== --- oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/FullTextSolrSearchTest.java (revision 0) +++ oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/FullTextSolrSearchTest.java (working copy) @@ -0,0 +1,116 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.jackrabbit.oak.benchmark; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.io.StringReader; +import javax.jcr.Repository; + +import org.apache.commons.io.FileUtils; +import org.apache.commons.io.IOUtils; +import org.apache.jackrabbit.oak.fixture.JcrCustomizer; +import org.apache.jackrabbit.oak.fixture.OakRepositoryFixture; +import org.apache.jackrabbit.oak.fixture.RepositoryFixture; +import org.apache.jackrabbit.oak.jcr.Jcr; +import org.apache.jackrabbit.oak.plugins.index.solr.configuration.DefaultSolrConfiguration; +import org.apache.jackrabbit.oak.plugins.index.solr.configuration.EmbeddedSolrServerConfiguration; +import org.apache.jackrabbit.oak.plugins.index.solr.configuration.OakSolrConfiguration; +import org.apache.jackrabbit.oak.plugins.index.solr.configuration.OakSolrConfigurationProvider; +import org.apache.jackrabbit.oak.plugins.index.solr.index.SolrIndexEditorProvider; +import org.apache.jackrabbit.oak.plugins.index.solr.query.SolrQueryIndexProvider; +import org.apache.jackrabbit.oak.plugins.index.solr.server.EmbeddedSolrServerProvider; +import org.apache.jackrabbit.oak.plugins.index.solr.server.SolrServerProvider; +import org.apache.jackrabbit.oak.plugins.index.solr.util.SolrIndexInitializer; +import org.apache.solr.client.solrj.SolrServer; +import org.apache.solr.client.solrj.embedded.EmbeddedSolrServer; +import org.apache.solr.client.solrj.request.CoreAdminRequest; +import org.apache.solr.client.solrj.response.CoreAdminResponse; +import org.apache.solr.common.params.CoreAdminParams; + +public class FullTextSolrSearchTest extends FullTextSearchTest { + + private SolrServerProvider serverProvider; + + public FullTextSolrSearchTest(File dump, boolean flat, boolean doReport, Boolean storageEnabled) { + super(dump, flat, doReport, storageEnabled); + } + + @Override + protected Repository[] createRepository(RepositoryFixture fixture) throws Exception { + initializeProvider(); + if (fixture instanceof OakRepositoryFixture) { + return ((OakRepositoryFixture) fixture).setUpCluster(1, new JcrCustomizer() { + @Override + public Jcr customize(Jcr jcr) { + OakSolrConfigurationProvider configurationProvider = new OakSolrConfigurationProvider() { + public OakSolrConfiguration getConfiguration() { + return new DefaultSolrConfiguration() { + @Override + public int getRows() { + return 50; + } + }; + } + }; + jcr.with(new SolrQueryIndexProvider(serverProvider, configurationProvider)) + .with(new SolrIndexEditorProvider(serverProvider, configurationProvider)) + .with(new SolrIndexInitializer(false)); + return jcr; + } + }); + } + return super.createRepository(fixture); + } + + private void initializeProvider() throws Exception { + String tempDirectoryPath = FileUtils.getTempDirectoryPath(); + File solrHome = new File(tempDirectoryPath, "solr" + System.nanoTime()); + EmbeddedSolrServerConfiguration embeddedSolrServerConfiguration = new EmbeddedSolrServerConfiguration(solrHome.getAbsolutePath(), "", "oak"); + serverProvider = new EmbeddedSolrServerProvider(embeddedSolrServerConfiguration); + SolrServer solrServer = serverProvider.getSolrServer(); + if (storageEnabled != null && !storageEnabled) { + // programmatically change schema.xml and reload the core + File schemaXML = new File(solrHome.getAbsolutePath() + "/oak/conf", "schema.xml"); + InputStream inputStream = getClass().getResourceAsStream("/solr/oak/conf/schema.xml"); + String schemaString = IOUtils.toString(inputStream).replace("", + ""); + FileOutputStream fileOutputStream = new FileOutputStream(schemaXML); + IOUtils.copy(new StringReader(schemaString), fileOutputStream); + fileOutputStream.flush(); + if (solrServer instanceof EmbeddedSolrServer) { + ((EmbeddedSolrServer) solrServer).getCoreContainer().reload("oak"); + } else { + CoreAdminRequest adminRequest = new CoreAdminRequest(); + adminRequest.setAction(CoreAdminParams.CoreAdminAction.RELOAD); + CoreAdminResponse adminResponse = adminRequest.process(solrServer); + assert 0 == adminResponse.getStatus(); + } + } + } + + @Override + protected void afterSuite() throws Exception { + SolrServer solrServer = serverProvider.getSolrServer(); + if (solrServer != null) { + solrServer.shutdown(); + } + } +} Property changes on: oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/FullTextSolrSearchTest.java ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property