jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomm...@apache.org
Subject svn commit: r1530880 [1/2] - in /jackrabbit/oak/trunk: oak-parent/ 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/configuration/ oak-solr...
Date Thu, 10 Oct 2013 08:53:33 GMT
Author: tommaso
Date: Thu Oct 10 08:53:31 2013
New Revision: 1530880

URL: http://svn.apache.org/r1530880
Log:
OAK-1078 - moved generic configuration stuff in oak-solr-core

Added:
    jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/
    jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/CommitPolicy.java   (with props)
    jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/DefaultSolrConfiguration.java   (with props)
    jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/DefaultSolrConfigurationProvider.java   (with props)
    jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/FixedNodeStateConfiguration.java   (with props)
    jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/OakSolrConfiguration.java   (with props)
    jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/OakSolrConfigurationProvider.java   (with props)
    jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/OakSolrNodeStateConfiguration.java   (with props)
    jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/SolrServerConfiguration.java   (with props)
    jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/SolrServerConfigurationDefaults.java   (with props)
    jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/SolrServerConfigurationProvider.java   (with props)
    jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/UpToDateNodeStateConfiguration.java   (with props)
    jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/server/
    jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/server/DefaultSolrServerProvider.java   (with props)
    jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/server/SolrServerProvider.java   (with props)
    jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/util/
    jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/util/OakSolrUtils.java   (with props)
    jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/util/SolrIndexInitializer.java   (with props)
    jackrabbit/oak/trunk/oak-solr-core/src/main/resources/
    jackrabbit/oak/trunk/oak-solr-core/src/main/resources/solr/
    jackrabbit/oak/trunk/oak-solr-core/src/main/resources/solr/oak/
    jackrabbit/oak/trunk/oak-solr-core/src/main/resources/solr/oak/conf/
    jackrabbit/oak/trunk/oak-solr-core/src/main/resources/solr/oak/conf/currency.xml   (with props)
    jackrabbit/oak/trunk/oak-solr-core/src/main/resources/solr/oak/conf/schema.xml   (with props)
    jackrabbit/oak/trunk/oak-solr-core/src/main/resources/solr/oak/conf/solrconfig.xml   (with props)
    jackrabbit/oak/trunk/oak-solr-core/src/main/resources/solr/solr.xml   (with props)
    jackrabbit/oak/trunk/oak-solr-core/src/main/resources/solr/zoo.cfg
    jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/
    jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/FixedNodeStateConfigurationTest.java   (with props)
    jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/UpToDateNodeStateConfigurationTest.java   (with props)
Removed:
    jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/CommitPolicy.java
    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/OakSolrConfigurationProvider.java
    jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/OakSolrUtils.java
    jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/SolrIndexInitializer.java
    jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/SolrServerProvider.java
    jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/FixedNodeStateConfiguration.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/SolrServerConfigurationDefaults.java
    jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/SolrServerConfigurationProvider.java
    jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/UpToDateNodeStateConfiguration.java
    jackrabbit/oak/trunk/oak-solr-embedded/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/UpToDateNodeStateConfigurationTest.java
Modified:
    jackrabbit/oak/trunk/oak-parent/pom.xml
    jackrabbit/oak/trunk/oak-solr-core/pom.xml
    jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/index/SolrIndexEditor.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-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/SolrBaseTest.java
    jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/TestUtils.java
    jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/index/SolrCommitHookIT.java
    jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/index/SolrIndexHookIT.java
    jackrabbit/oak/trunk/oak-solr-embedded/pom.xml
    jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/EmbeddedSolrConfiguration.java
    jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/EmbeddedSolrConfigurationProvider.java
    jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/EmbeddedSolrServerProvider.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
    jackrabbit/oak/trunk/oak-solr-embedded/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/EmbeddedSolrServerProviderTest.java
    jackrabbit/oak/trunk/oak-solr-remote/pom.xml
    jackrabbit/oak/trunk/oak-solr-remote/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/http/RemoteSolrConfigurationProvider.java
    jackrabbit/oak/trunk/oak-solr-remote/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/http/RemoteSolrServerProvider.java
    jackrabbit/oak/trunk/oak-solr-remote/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/http/RemoteSolrServerProviderIT.java

Modified: jackrabbit/oak/trunk/oak-parent/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-parent/pom.xml?rev=1530880&r1=1530879&r2=1530880&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-parent/pom.xml (original)
+++ jackrabbit/oak/trunk/oak-parent/pom.xml Thu Oct 10 08:53:31 2013
@@ -46,7 +46,7 @@
     <mongo.db>MongoMKDB</mongo.db>
     <mongo.db2>MongoMKDB2</mongo.db2>
     <segment.db>SegmentMK</segment.db>
-    <solr.version>4.0.0</solr.version>
+    <solr.version>4.1.0</solr.version>
     <!-- Note that we're using SLF4J API version 1.6 when compiling     -->
     <!-- core Oak components but more recent SLF4J and Logback versions -->
     <!-- when compiling and running test cases and the oak-run jar.     -->

Modified: jackrabbit/oak/trunk/oak-solr-core/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/pom.xml?rev=1530880&r1=1530879&r2=1530880&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/pom.xml (original)
+++ jackrabbit/oak/trunk/oak-solr-core/pom.xml Thu Oct 10 08:53:31 2013
@@ -40,9 +40,11 @@
         <configuration>
           <instructions>
             <Export-Package>
-              org.apache.jackrabbit.oak.plugins.index.solr,
+              org.apache.jackrabbit.oak.plugins.index.solr.configuration,
               org.apache.jackrabbit.oak.plugins.index.solr.index,
-              org.apache.jackrabbit.oak.plugins.index.solr.query
+              org.apache.jackrabbit.oak.plugins.index.solr.query,
+              org.apache.jackrabbit.oak.plugins.index.solr.server,
+              org.apache.jackrabbit.oak.plugins.index.solr.util
             </Export-Package>
             <Embed-Dependency>solr-solrj</Embed-Dependency>
           </instructions>
@@ -54,7 +56,6 @@
       </plugin>
       <plugin>
         <artifactId>maven-failsafe-plugin</artifactId>
-        <version>2.12</version>
         <executions>
           <execution>
             <goals>
@@ -169,7 +170,6 @@
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
-      <version>4.7</version>
       <scope>test</scope>
     </dependency>
     <dependency>

Added: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/CommitPolicy.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/CommitPolicy.java?rev=1530880&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/CommitPolicy.java (added)
+++ jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/CommitPolicy.java Thu Oct 10 08:53:31 2013
@@ -0,0 +1,35 @@
+/*
+ * 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.plugins.index.solr.configuration;
+
+/**
+ * Enum for describing Solr commit policy used in a certain instance
+ */
+public enum CommitPolicy {
+    /**
+     * for default Solr commit
+     */
+    HARD,
+    /**
+     * for Solr soft commit
+     */
+    SOFT,
+    /**
+     * if no commits should be sent (relying on auto(soft)commit on the instance itself)
+     */
+    AUTO
+}

Propchange: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/CommitPolicy.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/DefaultSolrConfiguration.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/DefaultSolrConfiguration.java?rev=1530880&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/DefaultSolrConfiguration.java (added)
+++ jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/DefaultSolrConfiguration.java Thu Oct 10 08:53:31 2013
@@ -0,0 +1,80 @@
+/*
+ * 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.plugins.index.solr.configuration;
+
+import org.apache.jackrabbit.oak.api.Type;
+import org.apache.jackrabbit.oak.spi.query.Filter;
+
+/**
+ * An {@link org.apache.jackrabbit.oak.plugins.index.solr.configuration.OakSolrConfiguration} for the embedded Solr server
+ */
+public class DefaultSolrConfiguration implements OakSolrConfiguration {
+
+    @Override
+    public String getFieldNameFor(Type<?> propertyType) {
+        if (Type.BINARIES.equals(propertyType) || Type.BINARY.equals(propertyType)) {
+            // TODO : use Tika / SolrCell here
+            return propertyType.toString() + "_bin";
+        }
+        return null;
+    }
+
+    @Override
+    public String getPathField() {
+        return SolrServerConfigurationDefaults.PATH_FIELD_NAME;
+    }
+
+    @Override
+    public String getFieldForPathRestriction(Filter.PathRestriction pathRestriction) {
+        String fieldName = null;
+        switch (pathRestriction) {
+            case ALL_CHILDREN: {
+                fieldName = SolrServerConfigurationDefaults.DESC_FIELD_NAME;
+                break;
+            }
+            case DIRECT_CHILDREN: {
+                fieldName = SolrServerConfigurationDefaults.CHILD_FIELD_NAME;
+                break;
+            }
+            case EXACT: {
+                fieldName = SolrServerConfigurationDefaults.PATH_FIELD_NAME;
+                break;
+            }
+            case PARENT: {
+                fieldName = SolrServerConfigurationDefaults.ANC_FIELD_NAME;
+                break;
+            }
+            case NO_RESTRICTION:
+                break;
+            default:
+                break;
+
+        }
+        return fieldName;
+    }
+
+    @Override
+    public String getFieldForPropertyRestriction(Filter.PropertyRestriction propertyRestriction) {
+        return null;
+    }
+
+    @Override
+    public CommitPolicy getCommitPolicy() {
+        return CommitPolicy.SOFT;
+    }
+
+}

Propchange: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/DefaultSolrConfiguration.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/DefaultSolrConfigurationProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/DefaultSolrConfigurationProvider.java?rev=1530880&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/DefaultSolrConfigurationProvider.java (added)
+++ jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/DefaultSolrConfigurationProvider.java Thu Oct 10 08:53:31 2013
@@ -0,0 +1,39 @@
+/*
+ * 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.plugins.index.solr.configuration;
+
+
+/**
+ * The default {@link org.apache.jackrabbit.oak.plugins.index.solr.configuration.OakSolrConfigurationProvider}
+ */
+public class DefaultSolrConfigurationProvider implements OakSolrConfigurationProvider {
+
+    private final OakSolrConfiguration defaultConfiguration;
+
+    public DefaultSolrConfigurationProvider() {
+        defaultConfiguration = new DefaultSolrConfiguration();
+    }
+
+    public DefaultSolrConfigurationProvider(OakSolrConfiguration configuration) {
+        this.defaultConfiguration = configuration;
+    }
+
+    @Override
+    public OakSolrConfiguration getConfiguration() {
+        return defaultConfiguration;
+    }
+}

Propchange: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/DefaultSolrConfigurationProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/FixedNodeStateConfiguration.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/FixedNodeStateConfiguration.java?rev=1530880&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/FixedNodeStateConfiguration.java (added)
+++ jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/FixedNodeStateConfiguration.java Thu Oct 10 08:53:31 2013
@@ -0,0 +1,37 @@
+/*
+ * 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.plugins.index.solr.configuration;
+
+import org.apache.jackrabbit.oak.spi.state.NodeState;
+
+/**
+ * A {@link OakSolrNodeStateConfiguration} whose {@link org.apache.jackrabbit.oak.spi.state.NodeState} is given once
+ * and never updated so that the configuration is fixed.
+ */
+public class FixedNodeStateConfiguration extends OakSolrNodeStateConfiguration {
+
+    private final NodeState configurationNodeState;
+
+    public FixedNodeStateConfiguration(NodeState configurationNodeState) {
+        this.configurationNodeState = configurationNodeState;
+    }
+
+    @Override
+    protected NodeState getConfigurationNodeState() {
+        return configurationNodeState;
+    }
+}

Propchange: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/FixedNodeStateConfiguration.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/OakSolrConfiguration.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/OakSolrConfiguration.java?rev=1530880&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/OakSolrConfiguration.java (added)
+++ jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/OakSolrConfiguration.java Thu Oct 10 08:53:31 2013
@@ -0,0 +1,66 @@
+/*
+ * 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.plugins.index.solr.configuration;
+
+import org.apache.jackrabbit.oak.api.Type;
+import org.apache.jackrabbit.oak.spi.query.Filter;
+
+/**
+ * A Solr configuration holding all the possible customizable parameters that
+ * can be leveraged for an Oak search index.
+ */
+public interface OakSolrConfiguration {
+
+    /**
+     * Provide a field name to be used for indexing / searching a certain {@link org.apache.jackrabbit.oak.api.Type}
+     *
+     * @param propertyType the {@link org.apache.jackrabbit.oak.api.Type} to be indexed / searched
+     * @return a <code>String</code> representing the Solr field to be used for the given {@link org.apache.jackrabbit.oak.api.Type}.
+     */
+    public String getFieldNameFor(Type<?> propertyType);
+
+    /**
+     * Provide the field name for indexing / searching paths
+     *
+     * @return a <code>String</code> representing the Solr field to be used for paths.
+     */
+    public String getPathField();
+
+    /**
+     * Provide a field name to search over for the given {@link org.apache.jackrabbit.oak.spi.query.Filter.PathRestriction}
+     *
+     * @param pathRestriction the {@link org.apache.jackrabbit.oak.spi.query.Filter.PathRestriction} used for filtering search results
+     * @return the field name as a <code>String</code> to be used by Solr for the given restriction
+     */
+    public String getFieldForPathRestriction(Filter.PathRestriction pathRestriction);
+
+    /**
+     * Provide a field name to search over for the given {@link org.apache.jackrabbit.oak.spi.query.Filter.PropertyRestriction}
+     *
+     * @param propertyRestriction the {@link org.apache.jackrabbit.oak.spi.query.Filter.PropertyRestriction} used for filtering search results
+     * @return the field name as a <code>String</code> to be used by Solr for the given restriction
+     */
+    public String getFieldForPropertyRestriction(Filter.PropertyRestriction propertyRestriction);
+
+    /**
+     * Provide the commit policy to be used with the underlying Solr instance
+     *
+     * @return a {@link org.apache.jackrabbit.oak.plugins.index.solr.configuration.CommitPolicy}
+     */
+    public CommitPolicy getCommitPolicy();
+
+}

Propchange: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/OakSolrConfiguration.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/OakSolrConfigurationProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/OakSolrConfigurationProvider.java?rev=1530880&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/OakSolrConfigurationProvider.java (added)
+++ jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/OakSolrConfigurationProvider.java Thu Oct 10 08:53:31 2013
@@ -0,0 +1,30 @@
+/*
+ * 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.plugins.index.solr.configuration;
+
+/**
+ * A provider for {@link org.apache.jackrabbit.oak.plugins.index.solr.configuration.OakSolrConfiguration}s
+ */
+public interface OakSolrConfigurationProvider {
+
+    /**
+     * Provides a Solr configuration for Oak
+     *
+     * @return a {@link org.apache.jackrabbit.oak.plugins.index.solr.configuration.OakSolrConfiguration}
+     */
+    public OakSolrConfiguration getConfiguration();
+}

Propchange: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/OakSolrConfigurationProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/OakSolrNodeStateConfiguration.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/OakSolrNodeStateConfiguration.java?rev=1530880&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/OakSolrNodeStateConfiguration.java (added)
+++ jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/OakSolrNodeStateConfiguration.java Thu Oct 10 08:53:31 2013
@@ -0,0 +1,141 @@
+/*
+ * 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.plugins.index.solr.configuration;
+
+import org.apache.jackrabbit.oak.api.PropertyState;
+import org.apache.jackrabbit.oak.api.Type;
+import org.apache.jackrabbit.oak.spi.query.Filter;
+import org.apache.jackrabbit.oak.spi.state.NodeState;
+
+/**
+ * An {@link OakSolrConfiguration} specified via a given {@link org.apache.jackrabbit.oak.spi.state.NodeState}.
+ * For each of the supported properties a default is provided if either the
+ * property doesn't exist in the node or if the value is <code>null</code> or
+ * empty <code>String</code>.
+ * <p/>
+ * Subclasses of this should at least provide the {@link org.apache.jackrabbit.oak.spi.state.NodeState} which holds
+ * the configuration.
+ */
+public abstract class OakSolrNodeStateConfiguration implements OakSolrConfiguration, SolrServerConfigurationProvider {
+
+    /**
+     * get the {@link org.apache.jackrabbit.oak.spi.state.NodeState} which contains the properties for the Oak -
+     * Solr configuration.
+     *
+     * @return a (possibly non-existent) node state for the Solr configuration
+     */
+    protected abstract NodeState getConfigurationNodeState();
+
+    @Override
+    public String getFieldNameFor(Type<?> propertyType) {
+        if (Type.BINARIES.equals(propertyType) || Type.BINARY.equals(propertyType)) {
+            // TODO : use Tika / SolrCell here
+            return propertyType.toString() + "_bin";
+        }
+        return null;
+    }
+
+    @Override
+    public String getFieldForPropertyRestriction(Filter.PropertyRestriction propertyRestriction) {
+        return null;
+    }
+
+    @Override
+    public String getPathField() {
+        return getStringValueFor(Properties.PATH_FIELD, SolrServerConfigurationDefaults.PATH_FIELD_NAME);
+    }
+
+    @Override
+    public String getFieldForPathRestriction(Filter.PathRestriction pathRestriction) {
+        String fieldName = null;
+        switch (pathRestriction) {
+            case ALL_CHILDREN: {
+                fieldName = getStringValueFor(Properties.DESCENDANTS_FIELD, SolrServerConfigurationDefaults.DESC_FIELD_NAME);
+                break;
+            }
+            case DIRECT_CHILDREN: {
+                fieldName = getStringValueFor(Properties.CHILDREN_FIELD, SolrServerConfigurationDefaults.CHILD_FIELD_NAME);
+                break;
+            }
+            case EXACT: {
+                fieldName = getStringValueFor(Properties.PATH_FIELD, SolrServerConfigurationDefaults.PATH_FIELD_NAME);
+                break;
+            }
+            case PARENT: {
+                fieldName = getStringValueFor(Properties.PARENT_FIELD, SolrServerConfigurationDefaults.ANC_FIELD_NAME);
+                break;
+            }
+            case NO_RESTRICTION:
+                break;
+            default:
+                break;
+
+        }
+        return fieldName;
+    }
+
+    @Override
+    public CommitPolicy getCommitPolicy() {
+        return CommitPolicy.valueOf(getStringValueFor(Properties.COMMIT_POLICY, CommitPolicy.SOFT.toString()));
+    }
+
+    protected String getStringValueFor(String propertyName, String defaultValue) {
+        String value = null;
+        NodeState configurationNodeState = getConfigurationNodeState();
+        if (configurationNodeState.exists()) {
+            PropertyState property = configurationNodeState.getProperty(propertyName);
+            if (property != null) {
+                value = property.getValue(Type.STRING);
+            }
+        }
+        if (value == null || value.length() == 0) {
+            value = defaultValue;
+        }
+        return value;
+    }
+
+    @Override
+    public SolrServerConfiguration getSolrServerConfiguration() {
+        String solrHomePath = getStringValueFor(Properties.SOLRHOME_PATH, SolrServerConfigurationDefaults.SOLR_HOME_PATH);
+        String solrConfigPath = getStringValueFor(Properties.SOLRCONFIG_PATH, SolrServerConfigurationDefaults.SOLR_CONFIG_PATH);
+        String coreName = getStringValueFor(Properties.CORE_NAME, SolrServerConfigurationDefaults.CORE_NAME);
+
+        String context = getStringValueFor(Properties.CONTEXT, SolrServerConfigurationDefaults.CONTEXT);
+        Integer httpPort = Integer.valueOf(getStringValueFor(Properties.HTTP_PORT, SolrServerConfigurationDefaults.HTTP_PORT));
+
+        return new SolrServerConfiguration(solrHomePath,
+                solrConfigPath, coreName).withHttpConfiguration(context, httpPort);
+    }
+
+    /**
+     * Properties that may be retrieved from the configuration {@link org.apache.jackrabbit.oak.spi.state.NodeState}.
+     */
+    public final class Properties {
+
+        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 = "httpPort";
+        public static final String CORE_NAME = "coreName";
+        public static final String PATH_FIELD = "pathField";
+        public static final String PARENT_FIELD = "parentField";
+        public static final String CHILDREN_FIELD = "childrenField";
+        public static final String DESCENDANTS_FIELD = "descendantsField";
+        public static final String COMMIT_POLICY = "commitPolicy";
+
+    }
+}

Propchange: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/OakSolrNodeStateConfiguration.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/SolrServerConfiguration.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/SolrServerConfiguration.java?rev=1530880&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/SolrServerConfiguration.java (added)
+++ jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/SolrServerConfiguration.java Thu Oct 10 08:53:31 2013
@@ -0,0 +1,97 @@
+/*
+ * 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.plugins.index.solr.configuration;
+
+/**
+ * Configuration parameters for starting a {@link org.apache.solr.client.solrj.SolrServer}
+ */
+public class SolrServerConfiguration {
+
+    private final String solrHomePath;
+    private final String solrConfigPath;
+    private final String coreName;
+    private HttpConfiguration httpConfiguration;
+
+    public SolrServerConfiguration(String solrHomePath, String solrConfigPath, String coreName) {
+        this.solrHomePath = solrHomePath;
+        this.solrConfigPath = solrConfigPath;
+        this.coreName = coreName;
+    }
+
+    public SolrServerConfiguration withHttpConfiguration(String context, Integer httpPort) {
+        if (context != null && context.length() > 0 && httpPort != null && httpPort > 0) {
+            this.httpConfiguration = new HttpConfiguration(context, httpPort);
+        }
+        return this;
+    }
+
+    /**
+     * get the Solr home path where all the configuration files are stored
+     *
+     * @return a <code>String</code> representing a path to the Solr home.
+     */
+    public String getSolrHomePath() {
+        return solrHomePath;
+    }
+
+    /**
+     * get the name of the main Solr configuration file (solr.xml for multicore
+     * deployments or solrconfig.xml for single core deployments).
+     *
+     * @return a <code>String</code> representing a path to the main Solr config file.
+     */
+    public String getSolrConfigPath() {
+        return solrConfigPath;
+    }
+
+    /**
+     * get the default core name to use for the Solr server
+     *
+     * @return a <code>String</code> representing the core name
+     */
+    public String getCoreName() {
+        return coreName;
+    }
+
+    /**
+     * get the {@link org.apache.jackrabbit.oak.plugins.index.solr.configuration.SolrServerConfiguration.HttpConfiguration} holding parameters for enabling Solr
+     * server with HTTP bindings
+     *
+     * @return a {@link org.apache.jackrabbit.oak.plugins.index.solr.configuration.SolrServerConfiguration.HttpConfiguration} or <code>null</code> if not set
+     */
+    public HttpConfiguration getHttpConfiguration() {
+        return httpConfiguration;
+    }
+
+    public class HttpConfiguration {
+        private String context;
+        private Integer httpPort;
+
+        HttpConfiguration(String context, Integer httpPort) {
+            this.context = context;
+            this.httpPort = httpPort;
+        }
+
+        public String getContext() {
+            return context;
+        }
+
+        public Integer getHttpPort() {
+            return httpPort;
+        }
+    }
+}

Propchange: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/SolrServerConfiguration.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/SolrServerConfigurationDefaults.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/SolrServerConfigurationDefaults.java?rev=1530880&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/SolrServerConfigurationDefaults.java (added)
+++ jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/SolrServerConfigurationDefaults.java Thu Oct 10 08:53:31 2013
@@ -0,0 +1,37 @@
+/*
+ * 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.plugins.index.solr.configuration;
+
+/**
+ * Defaults for Solr server configurations.
+ */
+public class SolrServerConfigurationDefaults {
+
+    public static final String SOLR_HOME_PATH = "solr";
+    public static final String SOLR_CONFIG_PATH = "solr.xml";
+    public static final String CORE_NAME = "oak";
+
+    public static final String HTTP_PORT = "8983";
+    public static final String LOCAL_BASE_URL = "http://127.0.0.1";
+    public static final String CONTEXT = "/solr";
+
+    public static final String PATH_FIELD_NAME = "path_exact";
+    public static final String CHILD_FIELD_NAME = "path_child";
+    public static final String DESC_FIELD_NAME = "path_desc";
+    public static final String ANC_FIELD_NAME = "path_anc";
+
+}

Propchange: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/SolrServerConfigurationDefaults.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/SolrServerConfigurationProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/SolrServerConfigurationProvider.java?rev=1530880&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/SolrServerConfigurationProvider.java (added)
+++ jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/SolrServerConfigurationProvider.java Thu Oct 10 08:53:31 2013
@@ -0,0 +1,31 @@
+/*
+ * 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.plugins.index.solr.configuration;
+
+/**
+ * {@link org.apache.solr.client.solrj.SolrServer} configuration provider.
+ */
+public interface SolrServerConfigurationProvider {
+
+    /**
+     * Provide a {@lin SolrServerConfiguration} to be used to initialize a specific
+     * {@link org.apache.solr.client.solrj.SolrServer} implementation.
+     *
+     * @return the {@link org.apache.jackrabbit.oak.plugins.index.solr.configuration.SolrServerConfiguration} holding the configuration parameters
+     */
+    public SolrServerConfiguration getSolrServerConfiguration();
+}

Propchange: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/SolrServerConfigurationProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/UpToDateNodeStateConfiguration.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/UpToDateNodeStateConfiguration.java?rev=1530880&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/UpToDateNodeStateConfiguration.java (added)
+++ jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/UpToDateNodeStateConfiguration.java Thu Oct 10 08:53:31 2013
@@ -0,0 +1,44 @@
+/*
+ * 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.plugins.index.solr.configuration;
+
+import org.apache.jackrabbit.oak.spi.state.NodeState;
+import org.apache.jackrabbit.oak.spi.state.NodeStore;
+
+/**
+ * A {@link org.apache.jackrabbit.oak.plugins.index.solr.configuration.OakSolrNodeStateConfiguration} whose {@link org.apache.jackrabbit.oak.spi.state.NodeState} is retrieved
+ * via the {@link org.apache.jackrabbit.oak.spi.state.NodeStore} and a given <code>String</code> path.
+ */
+public class UpToDateNodeStateConfiguration extends OakSolrNodeStateConfiguration {
+
+    private final NodeStore store;
+    private final String path;
+
+    public UpToDateNodeStateConfiguration(NodeStore store, String path) {
+        this.store = store;
+        this.path = path;
+    }
+
+    @Override
+    protected NodeState getConfigurationNodeState() {
+        NodeState currentState = store.getRoot();
+        for (String child : path.split("/")) {
+            currentState = currentState.getChildNode(child);
+        }
+        return currentState;
+    }
+}

Propchange: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/UpToDateNodeStateConfiguration.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/index/SolrIndexEditor.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/index/SolrIndexEditor.java?rev=1530880&r1=1530879&r2=1530880&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/index/SolrIndexEditor.java (original)
+++ jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/index/SolrIndexEditor.java Thu Oct 10 08:53:31 2013
@@ -25,8 +25,8 @@ import org.apache.jackrabbit.oak.api.Pro
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.commons.PathUtils;
 import org.apache.jackrabbit.oak.plugins.index.IndexEditor;
-import org.apache.jackrabbit.oak.plugins.index.solr.OakSolrConfiguration;
-import org.apache.jackrabbit.oak.plugins.index.solr.OakSolrUtils;
+import org.apache.jackrabbit.oak.plugins.index.solr.configuration.OakSolrConfiguration;
+import org.apache.jackrabbit.oak.plugins.index.solr.util.OakSolrUtils;
 import org.apache.jackrabbit.oak.spi.commit.Editor;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeState;

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=1530880&r1=1530879&r2=1530880&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 Thu Oct 10 08:53:31 2013
@@ -19,7 +19,7 @@ package org.apache.jackrabbit.oak.plugin
 import java.util.Collection;
 
 import org.apache.jackrabbit.oak.api.PropertyValue;
-import org.apache.jackrabbit.oak.plugins.index.solr.OakSolrConfiguration;
+import org.apache.jackrabbit.oak.plugins.index.solr.configuration.OakSolrConfiguration;
 import org.apache.jackrabbit.oak.spi.query.Cursor;
 import org.apache.jackrabbit.oak.spi.query.Filter;
 import org.apache.jackrabbit.oak.spi.query.IndexRow;
@@ -73,18 +73,11 @@ public class SolrQueryIndex implements Q
     private SolrQuery getQuery(Filter filter) {
 
         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));
+        setDefaults(solrQuery);
 
         StringBuilder queryBuilder = new StringBuilder();
 
         // TODO : handle node type restriction
-
         Filter.PathRestriction pathRestriction = filter.getPathRestriction();
         if (pathRestriction != null) {
             String path = purgePath(filter);
@@ -106,7 +99,7 @@ public class SolrQueryIndex implements Q
         Collection<Filter.PropertyRestriction> propertyRestrictions = filter.getPropertyRestrictions();
         if (propertyRestrictions != null && !propertyRestrictions.isEmpty()) {
             for (Filter.PropertyRestriction pr : propertyRestrictions) {
-            	if (pr.propertyName.contains("/")) {
+                if (pr.propertyName.contains("/")) {
                     // lucene cannot handle child-level property restrictions
                     continue;
                 }
@@ -126,7 +119,7 @@ public class SolrQueryIndex implements Q
                     queryBuilder.append(configuration.getPathField());
                     queryBuilder.append(':');
                     queryBuilder.append(first);
-                    if (!first.equals("\\/")) {
+                    if (first!= null && !"\\/".equals(first)) {
                         queryBuilder.append("\\/");
                     }
                 } else {
@@ -167,6 +160,16 @@ public class SolrQueryIndex implements Q
         return solrQuery;
     }
 
+    private void setDefaults(SolrQuery 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));
+    }
+
     private static String createRangeQuery(String first, String last, boolean firstIncluding, boolean lastIncluding) {
         // TODO : handle inclusion / exclusion of bounds
         StringBuilder rangeQueryBuilder = new StringBuilder("[");

Added: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/server/DefaultSolrServerProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/server/DefaultSolrServerProvider.java?rev=1530880&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/server/DefaultSolrServerProvider.java (added)
+++ jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/server/DefaultSolrServerProvider.java Thu Oct 10 08:53:31 2013
@@ -0,0 +1,38 @@
+/*
+ * 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.plugins.index.solr.server;
+
+import org.apache.jackrabbit.oak.plugins.index.solr.configuration.SolrServerConfigurationDefaults;
+import org.apache.solr.client.solrj.SolrServer;
+import org.apache.solr.client.solrj.impl.HttpSolrServer;
+
+public class DefaultSolrServerProvider implements SolrServerProvider {
+
+    private SolrServer solrServer;
+
+    @Override
+    public SolrServer getSolrServer() throws Exception {
+        if (solrServer == null) {
+            String url = new StringBuilder(SolrServerConfigurationDefaults.LOCAL_BASE_URL)
+                            .append(':').append(SolrServerConfigurationDefaults.HTTP_PORT)
+                            .append(SolrServerConfigurationDefaults.CONTEXT).append('/')
+                            .append(SolrServerConfigurationDefaults.CORE_NAME).toString();
+            solrServer = new HttpSolrServer(url);
+        }
+        return solrServer;
+    }
+}

Propchange: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/server/DefaultSolrServerProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/server/SolrServerProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/server/SolrServerProvider.java?rev=1530880&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/server/SolrServerProvider.java (added)
+++ jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/server/SolrServerProvider.java Thu Oct 10 08:53:31 2013
@@ -0,0 +1,33 @@
+/*
+ * 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.plugins.index.solr.server;
+
+import org.apache.solr.client.solrj.SolrServer;
+
+/**
+ * Provider of {@link org.apache.solr.client.solrj.SolrServer}s instances
+ */
+public interface SolrServerProvider {
+
+    /**
+     * provides an already initialized {@link org.apache.solr.client.solrj.SolrServer} to be used from within Oak
+     *
+     * @return a {@link org.apache.solr.client.solrj.SolrServer} instance
+     * @throws Exception if anything goes wrong while providing the {@link org.apache.solr.client.solrj.SolrServer}
+     */
+    public SolrServer getSolrServer() throws Exception;
+}

Propchange: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/server/SolrServerProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/util/OakSolrUtils.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/util/OakSolrUtils.java?rev=1530880&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/util/OakSolrUtils.java (added)
+++ jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/util/OakSolrUtils.java Thu Oct 10 08:53:31 2013
@@ -0,0 +1,206 @@
+/*
+ * 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.plugins.index.solr.util;
+
+import java.io.IOException;
+
+import javax.annotation.Nonnull;
+
+import org.apache.jackrabbit.oak.plugins.index.solr.configuration.CommitPolicy;
+import org.apache.jackrabbit.oak.plugins.index.solr.configuration.DefaultSolrConfigurationProvider;
+import org.apache.jackrabbit.oak.plugins.index.solr.configuration.OakSolrConfigurationProvider;
+import org.apache.jackrabbit.oak.plugins.index.solr.query.SolrQueryIndexProvider;
+import org.apache.jackrabbit.oak.plugins.index.solr.server.DefaultSolrServerProvider;
+import org.apache.jackrabbit.oak.plugins.index.solr.server.SolrServerProvider;
+import org.apache.jackrabbit.oak.spi.query.QueryIndexProvider;
+import org.apache.solr.client.solrj.SolrServer;
+import org.apache.solr.client.solrj.SolrServerException;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleReference;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.ServiceReference;
+
+/**
+ * Utilities for Oak Solr integration.
+ */
+public class OakSolrUtils {
+
+    /**
+     * Check if a given Solr instance is alive
+     * 
+     * @param solrServer
+     *            the {@link org.apache.solr.client.solrj.SolrServer} used to communicate with the Solr instance
+     * @return <code>true</code> if the given Solr instance is alive and responding
+     * @throws java.io.IOException
+     *             if any low level IO error occurs
+     * @throws org.apache.solr.client.solrj.SolrServerException
+     *             if any error occurs while trying to communicate with the Solr instance
+     */
+    public static boolean checkServerAlive(@Nonnull SolrServer solrServer) 
+                    throws IOException, SolrServerException {
+        return solrServer.ping().getStatus() == 0;
+    }
+
+    /**
+     * adapts the OSGi Solr {@link org.apache.jackrabbit.oak.spi.query.QueryIndexProvider} service
+     * 
+     * @return a {@link org.apache.jackrabbit.oak.plugins.index.solr.query.SolrQueryIndexProvider}
+     */
+    public static QueryIndexProvider adaptOsgiQueryIndexProvider() {
+        QueryIndexProvider queryIndexProvider = null;
+        try {
+            BundleContext ctx = BundleReference.class
+                            .cast(SolrQueryIndexProvider.class.getClassLoader()).getBundle()
+                            .getBundleContext();
+
+            ServiceReference serviceReference = ctx.getServiceReference(QueryIndexProvider.class
+                            .getName());
+            if (serviceReference != null) {
+                queryIndexProvider = QueryIndexProvider.class
+                                .cast(ctx.getService(serviceReference));
+            }
+        } catch (Throwable e) {
+            // do nothing
+        }
+        return queryIndexProvider;
+    }
+
+    /**
+     * adapt the OSGi Solr {@link SolrServerProvider} service of a given extending class and tries
+     * to instantiate it if non existing.
+     * 
+     * @param providerClass
+     *            the {@link Class} extending {@link SolrServerProvider} to adapt or instantiate
+     * @param <T>
+     *            the {@link SolrServerProvider} extension
+     * @return a {@link SolrServerProvider} adapted from the OSGi service, or a directly
+     *         instantiated one or <code>null</code> if both failed
+     */
+    public static <T extends SolrServerProvider> SolrServerProvider adaptOsgiSolrServerProvider(
+                    Class<T> providerClass) {
+        SolrServerProvider solrServerProvider = null;
+        try {
+            BundleContext ctx = FrameworkUtil.getBundle(providerClass).getBundleContext();
+            ServiceReference serviceReference = ctx.getServiceReference(SolrServerProvider.class
+                            .getName());
+            if (serviceReference != null) {
+                solrServerProvider = SolrServerProvider.class
+                                .cast(ctx.getService(serviceReference));
+            }
+        } catch (Throwable e) {
+            // do nothing
+        }
+
+        return solrServerProvider;
+    }
+
+    public static <T extends SolrServerProvider> SolrServerProvider getSolrServerProvider(
+                    Class<T> providerClass) {
+        SolrServerProvider solrServerProvider = adaptOsgiSolrServerProvider(providerClass);
+        if (solrServerProvider == null && providerClass != null) {
+            try {
+                solrServerProvider = providerClass.newInstance();
+            } catch (InstantiationException e) {
+                // do nothing
+            } catch (IllegalAccessException e) {
+                // do nothing
+            }
+        }
+        if (solrServerProvider == null) {
+            solrServerProvider = new DefaultSolrServerProvider();
+        }
+        return solrServerProvider;
+    }
+
+    /**
+     * adapt the OSGi Solr {@link org.apache.jackrabbit.oak.plugins.index.solr.configuration.OakSolrConfigurationProvider} service of a given extending class
+     * and tries to instantiate it if non existing.
+     * 
+     * @param providerClass
+     *            the {@link Class} extending {@link org.apache.jackrabbit.oak.plugins.index.solr.configuration.OakSolrConfigurationProvider} to adapt or
+     *            instantiate
+     * @param <T>
+     *            the {@link org.apache.jackrabbit.oak.plugins.index.solr.configuration.OakSolrConfigurationProvider} extension
+     * @return a {@link org.apache.jackrabbit.oak.plugins.index.solr.configuration.OakSolrConfigurationProvider} adapted from the OSGi service, or a directly
+     *         instantiated one or <code>null</code> if both failed
+     */
+    public static <T extends OakSolrConfigurationProvider> OakSolrConfigurationProvider adaptOsgiOakSolrConfigurationProvider(
+                    Class<T> providerClass) {
+        OakSolrConfigurationProvider oakSolrConfigurationProvider = null;
+        try {
+            BundleContext ctx = FrameworkUtil.getBundle(providerClass).getBundleContext();
+            ServiceReference serviceReference = ctx
+                            .getServiceReference(OakSolrConfigurationProvider.class.getName());
+            if (serviceReference != null) {
+                oakSolrConfigurationProvider = OakSolrConfigurationProvider.class.cast(ctx
+                                .getService(serviceReference));
+            }
+        } catch (Throwable e) {
+            // do nothing
+        }
+
+        return oakSolrConfigurationProvider;
+    }
+
+    public static <T extends OakSolrConfigurationProvider> OakSolrConfigurationProvider getOakSolrConfigurationProvider(
+                    Class<T> providerClass) {
+        OakSolrConfigurationProvider oakSolrConfigurationProvider = OakSolrUtils
+                        .adaptOsgiOakSolrConfigurationProvider(providerClass);
+        if (oakSolrConfigurationProvider == null && providerClass != null) {
+            try {
+                oakSolrConfigurationProvider = providerClass.newInstance();
+            } catch (InstantiationException e) {
+                // do nothing
+            } catch (IllegalAccessException e) {
+                // do nothing
+            }
+        }
+        if (oakSolrConfigurationProvider == null) {
+            oakSolrConfigurationProvider = new DefaultSolrConfigurationProvider();
+        }
+        return oakSolrConfigurationProvider;
+    }
+
+    /**
+     * Trigger a Solr commit on the basis of the given commit policy (e.g. hard, soft, auto)
+     * 
+     * @param solrServer
+     *            the {@link org.apache.solr.client.solrj.SolrServer} used to communicate with the Solr instance
+     * @param commitPolicy
+     *            the {@link org.apache.jackrabbit.oak.plugins.index.solr.configuration.CommitPolicy} used to commit changes to a Solr index
+     * @throws java.io.IOException
+     *             if any low level IO error occurs
+     * @throws org.apache.solr.client.solrj.SolrServerException
+     *             if any error occurs while trying to communicate with the Solr instance
+     */
+    public static void commitByPolicy(SolrServer solrServer, CommitPolicy commitPolicy)
+                    throws IOException, SolrServerException {
+        switch (commitPolicy) {
+            case HARD: {
+                solrServer.commit();
+                break;
+            }
+            case SOFT: {
+                solrServer.commit(false, false, true);
+                break;
+            }
+            case AUTO: {
+                break;
+            }
+        }
+    }
+}

Propchange: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/util/OakSolrUtils.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/util/SolrIndexInitializer.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/util/SolrIndexInitializer.java?rev=1530880&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/util/SolrIndexInitializer.java (added)
+++ jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/util/SolrIndexInitializer.java Thu Oct 10 08:53:31 2013
@@ -0,0 +1,44 @@
+/*
+ * 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.plugins.index.solr.util;
+
+import javax.annotation.Nonnull;
+
+import org.apache.jackrabbit.JcrConstants;
+import org.apache.jackrabbit.oak.plugins.index.IndexConstants;
+import org.apache.jackrabbit.oak.spi.lifecycle.RepositoryInitializer;
+import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
+
+/**
+ * A {@link org.apache.jackrabbit.oak.spi.lifecycle.RepositoryInitializer} for Solr index
+ */
+public class SolrIndexInitializer implements RepositoryInitializer {
+
+    private static final String SOLR_IDX = "solr";
+
+    @Override
+    public void initialize(@Nonnull NodeBuilder builder) {
+        if (builder.hasChildNode(IndexConstants.INDEX_DEFINITIONS_NAME)
+                && !builder.getChildNode(IndexConstants.INDEX_DEFINITIONS_NAME).hasChildNode(SOLR_IDX)) {
+            builder = builder.getChildNode(IndexConstants.INDEX_DEFINITIONS_NAME).child(SOLR_IDX);
+            builder.setProperty(JcrConstants.JCR_PRIMARYTYPE, IndexConstants.INDEX_DEFINITIONS_NODE_TYPE)
+                   .setProperty(IndexConstants.TYPE_PROPERTY_NAME, "solr")
+                   .setProperty(IndexConstants.REINDEX_PROPERTY_NAME, "true");
+
+        }
+    }
+}

Propchange: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/util/SolrIndexInitializer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/oak/trunk/oak-solr-core/src/main/resources/solr/oak/conf/currency.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/main/resources/solr/oak/conf/currency.xml?rev=1530880&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/main/resources/solr/oak/conf/currency.xml (added)
+++ jackrabbit/oak/trunk/oak-solr-core/src/main/resources/solr/oak/conf/currency.xml Thu Oct 10 08:53:31 2013
@@ -0,0 +1,67 @@
+<?xml version="1.0" ?>
+<!--
+ 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.
+-->
+
+<!-- Example exchange rates file for CurrencyField type named "currency" in example schema -->
+
+<currencyConfig version="1.0">
+  <rates>
+    <!-- Updated from http://www.exchangerate.com/ at 2011-09-27 -->
+    <rate from="USD" to="ARS" rate="4.333871" comment="ARGENTINA Peso" />
+    <rate from="USD" to="AUD" rate="1.025768" comment="AUSTRALIA Dollar" />
+    <rate from="USD" to="EUR" rate="0.743676" comment="European Euro" />
+    <rate from="USD" to="BRL" rate="1.881093" comment="BRAZIL Real" />
+    <rate from="USD" to="CAD" rate="1.030815" comment="CANADA Dollar" />
+    <rate from="USD" to="CLP" rate="519.0996" comment="CHILE Peso" />
+    <rate from="USD" to="CNY" rate="6.387310" comment="CHINA Yuan" />
+    <rate from="USD" to="CZK" rate="18.47134" comment="CZECH REP. Koruna" />
+    <rate from="USD" to="DKK" rate="5.515436" comment="DENMARK Krone" />
+    <rate from="USD" to="HKD" rate="7.801922" comment="HONG KONG Dollar" />
+    <rate from="USD" to="HUF" rate="215.6169" comment="HUNGARY Forint" />
+    <rate from="USD" to="ISK" rate="118.1280" comment="ICELAND Krona" />
+    <rate from="USD" to="INR" rate="49.49088" comment="INDIA Rupee" />
+    <rate from="USD" to="XDR" rate="0.641358" comment="INTNL MON. FUND SDR" />
+    <rate from="USD" to="ILS" rate="3.709739" comment="ISRAEL Sheqel" />
+    <rate from="USD" to="JPY" rate="76.32419" comment="JAPAN Yen" />
+    <rate from="USD" to="KRW" rate="1169.173" comment="KOREA (SOUTH) Won" />
+    <rate from="USD" to="KWD" rate="0.275142" comment="KUWAIT Dinar" />
+    <rate from="USD" to="MXN" rate="13.85895" comment="MEXICO Peso" />
+    <rate from="USD" to="NZD" rate="1.285159" comment="NEW ZEALAND Dollar" />
+    <rate from="USD" to="NOK" rate="5.859035" comment="NORWAY Krone" />
+    <rate from="USD" to="PKR" rate="87.57007" comment="PAKISTAN Rupee" />
+    <rate from="USD" to="PEN" rate="2.730683" comment="PERU Sol" />
+    <rate from="USD" to="PHP" rate="43.62039" comment="PHILIPPINES Peso" />
+    <rate from="USD" to="PLN" rate="3.310139" comment="POLAND Zloty" />
+    <rate from="USD" to="RON" rate="3.100932" comment="ROMANIA Leu" />
+    <rate from="USD" to="RUB" rate="32.14663" comment="RUSSIA Ruble" />
+    <rate from="USD" to="SAR" rate="3.750465" comment="SAUDI ARABIA Riyal" />
+    <rate from="USD" to="SGD" rate="1.299352" comment="SINGAPORE Dollar" />
+    <rate from="USD" to="ZAR" rate="8.329761" comment="SOUTH AFRICA Rand" />
+    <rate from="USD" to="SEK" rate="6.883442" comment="SWEDEN Krona" />
+    <rate from="USD" to="CHF" rate="0.906035" comment="SWITZERLAND Franc" />
+    <rate from="USD" to="TWD" rate="30.40283" comment="TAIWAN Dollar" />
+    <rate from="USD" to="THB" rate="30.89487" comment="THAILAND Baht" />
+    <rate from="USD" to="AED" rate="3.672955" comment="U.A.E. Dirham" />
+    <rate from="USD" to="UAH" rate="7.988582" comment="UKRAINE Hryvnia" />
+    <rate from="USD" to="GBP" rate="0.647910" comment="UNITED KINGDOM Pound" />
+    
+    <!-- Cross-rates for some common currencies -->
+    <rate from="EUR" to="GBP" rate="0.869914" />  
+    <rate from="EUR" to="NOK" rate="7.800095" />  
+    <rate from="GBP" to="NOK" rate="8.966508" />  
+  </rates>
+</currencyConfig>

Propchange: jackrabbit/oak/trunk/oak-solr-core/src/main/resources/solr/oak/conf/currency.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/oak/trunk/oak-solr-core/src/main/resources/solr/oak/conf/schema.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/main/resources/solr/oak/conf/schema.xml?rev=1530880&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/main/resources/solr/oak/conf/schema.xml (added)
+++ jackrabbit/oak/trunk/oak-solr-core/src/main/resources/solr/oak/conf/schema.xml Thu Oct 10 08:53:31 2013
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ 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.
+-->
+<schema name="minimal" version="1.5">
+  <types>
+    <fieldType name="string" class="solr.StrField"/>
+    <fieldType name="descendent_path" class="solr.TextField">
+      <analyzer type="index">
+        <tokenizer class="solr.PathHierarchyTokenizerFactory" delimiter="/" />
+      </analyzer>
+      <analyzer type="query">
+        <tokenizer class="solr.KeywordTokenizerFactory" />
+      </analyzer>
+    </fieldType>
+    <fieldType name="children_path" class="solr.TextField">
+      <analyzer type="index">
+        <tokenizer class="solr.PathHierarchyTokenizerFactory" delimiter="/" skip="1" reverse="true" />
+        <filter class="solr.PatternReplaceFilterFactory" pattern="/" replacement="" replace="all"/>
+      </analyzer>
+      <analyzer type="query">
+        <tokenizer class="solr.KeywordTokenizerFactory" />
+        <filter class="solr.PatternReplaceFilterFactory" pattern="/" replacement="" replace="all"/>
+      </analyzer>
+    </fieldType>
+    <fieldType name="parent_path" class="solr.TextField">
+      <analyzer type="index">
+        <tokenizer class="solr.KeywordTokenizerFactory" />
+        <filter class="solr.PatternReplaceFilterFactory" pattern="/" replacement="" replace="all"/>
+      </analyzer>
+      <analyzer type="query">
+        <tokenizer class="solr.PathHierarchyTokenizerFactory" delimiter="/" skip="1" reverse="true"/>
+        <filter class="solr.PatternReplaceFilterFactory" pattern="/" replacement="" replace="all"/>
+      </analyzer>
+    </fieldType>
+    <fieldType name="text_keepcase" class="solr.TextField" positionIncrementGap="100">
+      <analyzer type="index">
+        <tokenizer class="solr.StandardTokenizerFactory"/>
+      </analyzer>
+      <analyzer type="query">
+        <tokenizer class="solr.StandardTokenizerFactory"/>
+      </analyzer>
+    </fieldType>
+    <fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
+      <analyzer type="index">
+        <tokenizer class="solr.StandardTokenizerFactory"/>
+        <filter class="solr.LowerCaseFilterFactory"/>
+      </analyzer>
+      <analyzer type="query">
+        <tokenizer class="solr.StandardTokenizerFactory"/>
+        <filter class="solr.LowerCaseFilterFactory"/>
+      </analyzer>
+    </fieldType>
+
+    <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true"/>
+
+    <fieldType name="int" class="solr.TrieIntField" precisionStep="0" positionIncrementGap="0"/>
+    <fieldType name="float" class="solr.TrieFloatField" precisionStep="0" positionIncrementGap="0"/>
+    <fieldType name="long" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0"/>
+    <fieldType name="double" class="solr.TrieDoubleField" precisionStep="0" positionIncrementGap="0"/>
+
+    <fieldType name="tint" class="solr.TrieIntField" precisionStep="8" positionIncrementGap="0"/>
+    <fieldType name="tfloat" class="solr.TrieFloatField" precisionStep="8" positionIncrementGap="0"/>
+    <fieldType name="tlong" class="solr.TrieLongField" precisionStep="8" positionIncrementGap="0"/>
+    <fieldType name="tdouble" class="solr.TrieDoubleField" precisionStep="8" positionIncrementGap="0"/>
+    <fieldType name="date" class="solr.TrieDateField" precisionStep="0" positionIncrementGap="0"/>
+
+    <fieldType name="tdate" class="solr.TrieDateField" precisionStep="6" positionIncrementGap="0"/>
+
+    <fieldtype name="binary" class="solr.BinaryField"/>
+
+    <fieldType name="pint" class="solr.IntField"/>
+    <fieldType name="plong" class="solr.LongField"/>
+    <fieldType name="pfloat" class="solr.FloatField"/>
+    <fieldType name="pdouble" class="solr.DoubleField"/>
+    <fieldType name="pdate" class="solr.DateField" sortMissingLast="true"/>
+
+    <fieldType name="point" class="solr.PointType" dimension="2" subFieldSuffix="_d"/>
+
+    <fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate"/>
+
+    <fieldType name="location_rpt" class="solr.SpatialRecursivePrefixTreeFieldType"
+               geo="true" distErrPct="0.025" maxDistErr="0.000009" units="degrees" />
+
+    <fieldType name="currency" class="solr.CurrencyField" precisionStep="8" defaultCurrency="USD" currencyConfig="currency.xml" />
+    <fieldtype name="ignored" stored="false" indexed="false" multiValued="true" class="solr.StrField"/>
+  </types>
+  <fields>
+    <field name="path_exact" type="string" indexed="true" stored="true"/>
+    <field name="path_child" type="children_path" indexed="true" stored="false"/>
+    <field name="path_anc" type="parent_path" indexed="true" stored="false"/>
+    <field name="path_des" type="descendent_path" indexed="true" stored="false"/>
+    <field name="ignored" type="ignored" multiValued="true"/>
+    <field name="catch_all" type="text_general" indexed="true" stored="false" multiValued="true"/>
+    <field name="_version_" type="long" indexed="true" stored="true"/>
+
+    <dynamicField name="*_i"  type="int"    indexed="true"  stored="true"/>
+    <dynamicField name="*_is" type="int"    indexed="true"  stored="true"  multiValued="true"/>
+    <dynamicField name="*_s"  type="string"  indexed="true"  stored="true" />
+    <dynamicField name="*_ss" type="string"  indexed="true"  stored="true" multiValued="true"/>
+    <dynamicField name="*_l"  type="long"   indexed="true"  stored="true"/>
+    <dynamicField name="*_ls" type="long"   indexed="true"  stored="true"  multiValued="true"/>
+    <dynamicField name="*_t"  type="text_general"    indexed="true"  stored="true"/>
+    <dynamicField name="*_txt" type="text_general"   indexed="true"  stored="true" multiValued="true"/>
+    <dynamicField name="*_b"  type="boolean" indexed="true" stored="true"/>
+    <dynamicField name="*_bs" type="boolean" indexed="true" stored="true"  multiValued="true"/>
+    <dynamicField name="*_f"  type="float"  indexed="true"  stored="true"/>
+    <dynamicField name="*_fs" type="float"  indexed="true"  stored="true"  multiValued="true"/>
+    <dynamicField name="*_d"  type="double" indexed="true"  stored="true"/>
+    <dynamicField name="*_ds" type="double" indexed="true"  stored="true"  multiValued="true"/>
+
+    <dynamicField name="*_coordinate"  type="tdouble" indexed="true"  stored="false" />
+
+    <dynamicField name="*_dt"  type="date"    indexed="true"  stored="true"/>
+    <dynamicField name="*_dts" type="date"    indexed="true"  stored="true" multiValued="true"/>
+    <dynamicField name="*_p"  type="location" indexed="true" stored="true"/>
+
+    <dynamicField name="*_ti" type="tint"    indexed="true"  stored="true"/>
+    <dynamicField name="*_tl" type="tlong"   indexed="true"  stored="true"/>
+    <dynamicField name="*_tf" type="tfloat"  indexed="true"  stored="true"/>
+    <dynamicField name="*_td" type="tdouble" indexed="true"  stored="true"/>
+    <dynamicField name="*_tdt" type="tdate"  indexed="true"  stored="true"/>
+
+    <dynamicField name="*_pi"  type="pint"    indexed="true"  stored="true"/>
+    <dynamicField name="*_c"   type="currency" indexed="true"  stored="true"/>
+    <dynamicField name="*" type="text_keepcase" indexed="true" stored="true" multiValued="true"/>
+  </fields>
+  <uniqueKey>path_exact</uniqueKey>
+  <copyField source="path_exact" dest="path_anc"/>
+  <copyField source="path_exact" dest="path_des"/>
+  <copyField source="path_exact" dest="path_child"/>
+  <copyField source="*" dest="catch_all"/>
+</schema>

Propchange: jackrabbit/oak/trunk/oak-solr-core/src/main/resources/solr/oak/conf/schema.xml
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message