jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomm...@apache.org
Subject svn commit: r1464977 - in /jackrabbit/oak/trunk: oak-solr-core/ oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/ oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/query/ oak-solr-embedded/src/main/java/or...
Date Fri, 05 Apr 2013 13:52:38 GMT
Author: tommaso
Date: Fri Apr  5 13:52:38 2013
New Revision: 1464977

URL: http://svn.apache.org/r1464977
Log:
OAK-735 - added lables to osgi services of oak-solr-embedded, added parsing of http configuration
to both osgi and nodestate based configurations, restored needed solrj embed in oak-solr-core

Modified:
    jackrabbit/oak/trunk/oak-solr-core/pom.xml
    jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/OakSolrConfiguration.java
    jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrQueryIndex.java
    jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/OakSolrNodeStateConfiguration.java
    jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/SolrServerConfiguration.java
    jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/osgi/EmbeddedSolrProviderService.java
    jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/osgi/OsgiSolrServerConfigurationProvider.java

Modified: jackrabbit/oak/trunk/oak-solr-core/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/pom.xml?rev=1464977&r1=1464976&r2=1464977&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/pom.xml (original)
+++ jackrabbit/oak/trunk/oak-solr-core/pom.xml Fri Apr  5 13:52:38 2013
@@ -44,12 +44,9 @@
             <Export-Package>
               org.apache.jackrabbit.oak.plugins.index.solr,
               org.apache.jackrabbit.oak.plugins.index.solr.index,
-              org.apache.jackrabbit.oak.plugins.index.solr.query,
-              org.apache.jackrabbit.oak.plugins.index.solr.server
+              org.apache.jackrabbit.oak.plugins.index.solr.query
             </Export-Package>
-            <Private-Package>
-              org.apache.jackrabbit.oak.plugins.index.solr.*
-            </Private-Package>
+            <Embed-Dependency>solr-solrj</Embed-Dependency>
           </instructions>
         </configuration>
       </plugin>

Modified: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/OakSolrConfiguration.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/OakSolrConfiguration.java?rev=1464977&r1=1464976&r2=1464977&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/OakSolrConfiguration.java
(original)
+++ jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/OakSolrConfiguration.java
Fri Apr  5 13:52:38 2013
@@ -48,7 +48,6 @@ public interface OakSolrConfiguration {
      */
     public String getFieldForPathRestriction(Filter.PathRestriction pathRestriction);
 
-
     /**
      * Provide a field name to search over for the given {@link Filter.PropertyRestriction}
      *

Modified: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrQueryIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrQueryIndex.java?rev=1464977&r1=1464976&r2=1464977&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrQueryIndex.java
(original)
+++ jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrQueryIndex.java
Fri Apr  5 13:52:38 2013
@@ -76,7 +76,10 @@ public class SolrQueryIndex implements Q
 
         SolrQuery solrQuery = new SolrQuery();
         solrQuery.setParam("q.op", "AND");
+
+        // TODO : change this to be not hard coded
         solrQuery.setParam("df", "catch_all");
+
         // TODO : can we handle this better?
         solrQuery.setParam("rows", String.valueOf(Integer.MAX_VALUE));
 

Modified: jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/OakSolrNodeStateConfiguration.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/OakSolrNodeStateConfiguration.java?rev=1464977&r1=1464976&r2=1464977&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/OakSolrNodeStateConfiguration.java
(original)
+++ jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/OakSolrNodeStateConfiguration.java
Fri Apr  5 13:52:38 2013
@@ -99,8 +99,14 @@ public abstract class OakSolrNodeStateCo
 
     @Override
     public SolrServerConfiguration getSolrServerConfiguration() {
-        return new SolrServerConfiguration(getStringValueFor(Properties.SOLRHOME_PATH, SolrServerConfigurationDefaults.SOLR_HOME_PATH),
-                getStringValueFor(Properties.SOLRCONFIG_PATH, SolrServerConfigurationDefaults.SOLR_CONFIG_PATH),
getCoreName());
+        String solrHomePath = getStringValueFor(Properties.SOLRHOME_PATH, SolrServerConfigurationDefaults.SOLR_HOME_PATH);
+        String solrConfigPath = getStringValueFor(Properties.SOLRCONFIG_PATH, SolrServerConfigurationDefaults.SOLR_CONFIG_PATH);
+
+        String context = getStringValueFor(Properties.CONTEXT, SolrServerConfigurationDefaults.CONTEXT);
+        Integer httpPort = Integer.valueOf(getStringValueFor(Properties.HTTP_PORT, SolrServerConfigurationDefaults.HTTP_PORT));
+
+        return new SolrServerConfiguration(solrHomePath,
+                solrConfigPath, getCoreName()).withHttpConfiguration(context, httpPort);
     }
 
     /**
@@ -110,6 +116,8 @@ public abstract class OakSolrNodeStateCo
 
         public static final String SOLRHOME_PATH = "solrHomePath";
         public static final String SOLRCONFIG_PATH = "solrConfigPath";
+        public static final String CONTEXT = "solrContext";
+        public static final String HTTP_PORT = "solrContext";
         public static final String CORE_NAME = "coreName";
         public static final String PATH_FIELD = "pathField";
         public static final String PARENT_FIELD = "parentField";

Modified: jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/SolrServerConfiguration.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/SolrServerConfiguration.java?rev=1464977&r1=1464976&r2=1464977&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/SolrServerConfiguration.java
(original)
+++ jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/SolrServerConfiguration.java
Fri Apr  5 13:52:38 2013
@@ -33,7 +33,9 @@ public class SolrServerConfiguration {
     }
 
     public SolrServerConfiguration withHttpConfiguration(String context, Integer httpPort)
{
-        this.httpConfiguration = new HttpConfiguration(context, httpPort);
+        if (context != null && context.length() > 0 && httpPort != null
&& httpPort > 0) {
+            this.httpConfiguration = new HttpConfiguration(context, httpPort);
+        }
         return this;
     }
 

Modified: jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/osgi/EmbeddedSolrProviderService.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/osgi/EmbeddedSolrProviderService.java?rev=1464977&r1=1464976&r2=1464977&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/osgi/EmbeddedSolrProviderService.java
(original)
+++ jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/osgi/EmbeddedSolrProviderService.java
Fri Apr  5 13:52:38 2013
@@ -25,8 +25,8 @@ import org.apache.felix.scr.annotations.
 import org.apache.jackrabbit.oak.plugins.index.solr.OakSolrConfiguration;
 import org.apache.jackrabbit.oak.plugins.index.solr.OakSolrConfigurationProvider;
 import org.apache.jackrabbit.oak.plugins.index.solr.SolrServerProvider;
-import org.apache.jackrabbit.oak.plugins.index.solr.embedded.EmbeddedSolrServerProvider;
 import org.apache.jackrabbit.oak.plugins.index.solr.embedded.EmbeddedSolrConfigurationProvider;
+import org.apache.jackrabbit.oak.plugins.index.solr.embedded.EmbeddedSolrServerProvider;
 import org.apache.jackrabbit.oak.plugins.index.solr.embedded.SolrServerConfigurationProvider;
 import org.apache.jackrabbit.oak.plugins.index.solr.embedded.UpToDateNodeStateConfiguration;
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
@@ -36,7 +36,8 @@ import org.osgi.service.component.Compon
 /**
  * OSGi service for the embedded Solr server module.
  */
-@Component
+@Component(metatype = true,
+        label = "Embedded SolrServer provider")
 @Services({
         @Service(value = SolrServerProvider.class),
         @Service(value = OakSolrConfigurationProvider.class)

Modified: jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/osgi/OsgiSolrServerConfigurationProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/osgi/OsgiSolrServerConfigurationProvider.java?rev=1464977&r1=1464976&r2=1464977&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/osgi/OsgiSolrServerConfigurationProvider.java
(original)
+++ jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/osgi/OsgiSolrServerConfigurationProvider.java
Fri Apr  5 13:52:38 2013
@@ -32,7 +32,8 @@ import org.osgi.service.component.Compon
 /**
  * An OSGi service {@link SolrServerConfigurationProvider}
  */
-@Component
+@Component(metatype = true,
+        label = "OSGi Solr server configuration provider")
 @Service(value = SolrServerConfigurationProvider.class)
 public class OsgiSolrServerConfigurationProvider implements SolrServerConfigurationProvider
{
 
@@ -48,6 +49,9 @@ public class OsgiSolrServerConfiguration
     @Property(value = SolrServerConfigurationDefaults.HTTP_PORT)
     private static final String SOLR_HTTP_PORT = "solr.http.port";
 
+    @Property(value = SolrServerConfigurationDefaults.CONTEXT)
+    private static final String SOLR_CONTEXT = "solr.context";
+
     private static SolrServer solrServer;
 
     private String solrHome;
@@ -55,6 +59,7 @@ public class OsgiSolrServerConfiguration
     private String solrCoreName;
 
     private Integer solrHttpPort;
+    private String solrContext;
 
     private SolrServerConfiguration solrServerConfiguration;
 
@@ -67,12 +72,13 @@ public class OsgiSolrServerConfiguration
             assert file.createNewFile();
         }
         solrConfigFile = String.valueOf(componentContext.getProperties().get(SOLR_CONFIG_FILE));
-        solrCoreName= String.valueOf(componentContext.getProperties().get(SOLR_CORE_NAME));
+        solrCoreName = String.valueOf(componentContext.getProperties().get(SOLR_CORE_NAME));
 
         solrHttpPort = Integer.valueOf(String.valueOf(componentContext.getProperties().get(SOLR_HTTP_PORT)));
-        // TODO : add the possibility to inject solrconfig and schema files
+        solrContext = String.valueOf(componentContext.getProperties().get(SOLR_CONTEXT));
 
-        solrServerConfiguration = new SolrServerConfiguration(solrHome, solrConfigFile, solrCoreName);
+        solrServerConfiguration = new SolrServerConfiguration(solrHome, solrConfigFile, solrCoreName).
+                withHttpConfiguration(solrContext, solrHttpPort);
     }
 
     @Deactivate
@@ -81,6 +87,7 @@ public class OsgiSolrServerConfiguration
         solrHttpPort = null;
         solrConfigFile = null;
         solrCoreName = null;
+        solrContext = null;
         if (solrServer != null) {
             solrServer.shutdown();
             solrServer = null;



Mime
View raw message