http://git-wip-us.apache.org/repos/asf/gora/blob/3b2f282d/gora-solr-5/src/test/conf/solr/WebPage/conf/synonyms.txt ---------------------------------------------------------------------- diff --git a/gora-solr-5/src/test/conf/solr/WebPage/conf/synonyms.txt b/gora-solr-5/src/test/conf/solr/WebPage/conf/synonyms.txt deleted file mode 100644 index f00294b..0000000 --- a/gora-solr-5/src/test/conf/solr/WebPage/conf/synonyms.txt +++ /dev/null @@ -1,29 +0,0 @@ -# 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. - -#----------------------------------------------------------------------- -#some test synonym mappings unlikely to appear in real input text -aaafoo => aaabar -bbbfoo => bbbfoo bbbbar -cccfoo => cccbar cccbaz -fooaaa,baraaa,bazaaa - -# Some synonym groups specific to this example -GB,gib,gigabyte,gigabytes -MB,mib,megabyte,megabytes -Television, Televisions, TV, TVs -#notice we use "gib" instead of "GiB" so any WordDelimiterFilter coming -#after us won't split it into two words. - -# Synonym mappings can be used for spelling correction too -pixima => pixma -
http://git-wip-us.apache.org/repos/asf/gora/blob/3b2f282d/gora-solr-5/src/test/conf/solr/collection1/conf/schema.xml ---------------------------------------------------------------------- diff --git a/gora-solr-5/src/test/conf/solr/collection1/conf/schema.xml b/gora-solr-5/src/test/conf/solr/collection1/conf/schema.xml deleted file mode 100644 index 77465c4..0000000 --- a/gora-solr-5/src/test/conf/solr/collection1/conf/schema.xml +++ /dev/null @@ -1,32 +0,0 @@ -<?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="testexample" version="1.5"> - <fields> - <!-- Common Fields --> - <field name="id" type="string" indexed="true" stored="true" required="true" multiValued="false" /> - <field name="_version_" type="long" indexed="true" stored="true"/> - </fields> - - <uniqueKey>id</uniqueKey> - - <types> - <fieldType name="string" class="solr.StrField" sortMissingLast="true" /> - <fieldType name="long" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0"/> - </types> -</schema> http://git-wip-us.apache.org/repos/asf/gora/blob/3b2f282d/gora-solr-5/src/test/conf/solr/collection1/conf/solrconfig.xml ---------------------------------------------------------------------- diff --git a/gora-solr-5/src/test/conf/solr/collection1/conf/solrconfig.xml b/gora-solr-5/src/test/conf/solr/collection1/conf/solrconfig.xml deleted file mode 100644 index cd05f61..0000000 --- a/gora-solr-5/src/test/conf/solr/collection1/conf/solrconfig.xml +++ /dev/null @@ -1,113 +0,0 @@ -<?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. ---> - -<!-- - For more details about configurations options that may appear in - this file, see http://wiki.apache.org/solr/SolrConfigXml. ---> -<config> - <luceneMatchVersion>6.5.1</luceneMatchVersion> - <dataDir>${solr.data.dir:}</dataDir> - <directoryFactory name="DirectoryFactory" - class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}"/> - <codecFactory class="solr.SchemaCodecFactory"/> - <schemaFactory class="ClassicIndexSchemaFactory"/> - <indexConfig> - <lockType>${solr.lock.type:native}</lockType> - </indexConfig> - - <jmx /> - - <updateHandler class="solr.DirectUpdateHandler2"> - <updateLog> - <str name="dir">${solr.ulog.dir:}</str> - </updateLog> - <autoCommit> - <maxTime>15000</maxTime> - <openSearcher>false</openSearcher> - </autoCommit> - </updateHandler> - - <query> - <maxBooleanClauses>1024</maxBooleanClauses> - <filterCache class="solr.FastLRUCache" - size="512" - initialSize="512" - autowarmCount="0"/> - <queryResultCache class="solr.LRUCache" - size="512" - initialSize="512" - autowarmCount="0"/> - <documentCache class="solr.LRUCache" - size="512" - initialSize="512" - autowarmCount="0"/> - <enableLazyFieldLoading>true</enableLazyFieldLoading> - <queryResultWindowSize>20</queryResultWindowSize> - <queryResultMaxDocsCached>200</queryResultMaxDocsCached> - <listener event="newSearcher" class="solr.QuerySenderListener"> - <arr name="queries"> - </arr> - </listener> - <listener event="firstSearcher" class="solr.QuerySenderListener"> - <arr name="queries"> - <lst> - <str name="q">static firstSearcher warming in solrconfig.xml</str> - </lst> - </arr> - </listener> - <useColdSearcher>false</useColdSearcher> - <maxWarmingSearchers>2</maxWarmingSearchers> - </query> - - <requestDispatcher handleSelect="false" > - <requestParsers enableRemoteStreaming="true" - multipartUploadLimitInKB="2048000" - formdataUploadLimitInKB="2048" - addHttpRequestToContext="false"/> - <httpCaching never304="true" /> - </requestDispatcher> - - <requestHandler name="/select" class="solr.SearchHandler"> - <lst name="defaults"> - <str name="echoParams">explicit</str> - <int name="rows">10</int> - <str name="df">id</str> - </lst> - </requestHandler> - - <requestHandler name="/query" class="solr.SearchHandler"> - <lst name="defaults"> - <str name="echoParams">explicit</str> - <str name="wt">json</str> - <str name="indent">true</str> - <str name="df">id</str> - </lst> - </requestHandler> - - <requestHandler name="/get" class="solr.RealTimeGetHandler"> - <lst name="defaults"> - <str name="omitHeader">true</str> - <str name="wt">json</str> - <str name="indent">true</str> - </lst> - </requestHandler> - - <requestHandler name="/update" class="solr.UpdateRequestHandler"> - </requestHandler> -</config> http://git-wip-us.apache.org/repos/asf/gora/blob/3b2f282d/gora-solr-5/src/test/conf/solr/collection1/core.properties ---------------------------------------------------------------------- diff --git a/gora-solr-5/src/test/conf/solr/collection1/core.properties b/gora-solr-5/src/test/conf/solr/collection1/core.properties deleted file mode 100644 index 4f7a094..0000000 --- a/gora-solr-5/src/test/conf/solr/collection1/core.properties +++ /dev/null @@ -1,18 +0,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. -# - -name=collection1 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/gora/blob/3b2f282d/gora-solr-5/src/test/conf/solr/solr.xml ---------------------------------------------------------------------- diff --git a/gora-solr-5/src/test/conf/solr/solr.xml b/gora-solr-5/src/test/conf/solr/solr.xml deleted file mode 100644 index be78e1f..0000000 --- a/gora-solr-5/src/test/conf/solr/solr.xml +++ /dev/null @@ -1,69 +0,0 @@ -<?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. ---> - -<!-- - This is an example of a simple "solr.xml" file for configuring one or - more Solr Cores, as well as allowing Cores to be added, removed, and - reloaded via HTTP requests. - - More information about options available in this configuration file, - and Solr Core administration can be found online: - http://wiki.apache.org/solr/CoreAdmin ---> - -<!-- - All (relative) paths are relative to the Solr Home Directory - - persistent: Save changes made via the API to this file - sharedLib: path to a lib directory that will be shared across all cores ---> -<solr> - <!-- by default, this is 50 @ WARN - <logging enabled="true"> - <watcher size="100" threshold="DEBUG" /> - </logging> - --> - - <!-- - adminPath: RequestHandler path to manage cores. - If 'null' (or absent), cores will not be manageable via request handler - defaultCoreName: (optional) core to use when no core name is specified in an access url - - All of the attributes in cores after defaultCoreName only apply when running in SolrCloud mode. - You can read more about SolrCloud mode at http://wiki.apache.org/solr/SolrCloud - --> - <solrcloud> - - <str name="host">${host:}</str> - <int name="hostPort">${jetty.port:8983}</int> - <str name="hostContext">${hostContext:solr}</str> - - <bool name="genericCoreNodeNames">${genericCoreNodeNames:true}</bool> - - <int name="zkClientTimeout">${zkClientTimeout:30000}</int> - <int name="distribUpdateSoTimeout">${distribUpdateSoTimeout:600000}</int> - <int name="distribUpdateConnTimeout">${distribUpdateConnTimeout:60000}</int> - - </solrcloud> - - <shardHandlerFactory name="shardHandlerFactory" - class="HttpShardHandlerFactory"> - <int name="socketTimeout">${socketTimeout:600000}</int> - <int name="connTimeout">${connTimeout:60000}</int> - </shardHandlerFactory> -</solr> http://git-wip-us.apache.org/repos/asf/gora/blob/3b2f282d/gora-solr-5/src/test/conf/solr/zoo.cfg ---------------------------------------------------------------------- diff --git a/gora-solr-5/src/test/conf/solr/zoo.cfg b/gora-solr-5/src/test/conf/solr/zoo.cfg deleted file mode 100644 index 09aca36..0000000 --- a/gora-solr-5/src/test/conf/solr/zoo.cfg +++ /dev/null @@ -1,34 +0,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. -# - -# The number of milliseconds of each tick -tickTime=2000 -# The number of ticks that the initial -# synchronization phase can take -initLimit=10 -# The number of ticks that can pass between -# sending a request and getting an acknowledgement -syncLimit=5 - -# the directory where the snapshot is stored. -# dataDir=/opt/zookeeper/data -# NOTE: Solr defaults the dataDir to <solrHome>/zoo_data - -# the port at which the clients will connect -# clientPort=2181 -# NOTE: Solr sets this based on zkRun / zkHost params - http://git-wip-us.apache.org/repos/asf/gora/blob/3b2f282d/gora-solr-5/src/test/java/org/apache/gora/solr/GoraSolrManagedSchemaTestDriver.java ---------------------------------------------------------------------- diff --git a/gora-solr-5/src/test/java/org/apache/gora/solr/GoraSolrManagedSchemaTestDriver.java b/gora-solr-5/src/test/java/org/apache/gora/solr/GoraSolrManagedSchemaTestDriver.java deleted file mode 100644 index 4b6a81a..0000000 --- a/gora-solr-5/src/test/java/org/apache/gora/solr/GoraSolrManagedSchemaTestDriver.java +++ /dev/null @@ -1,89 +0,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. - */ - -package org.apache.gora.solr; - -import org.apache.commons.io.FileUtils; -import org.apache.solr.client.solrj.embedded.JettySolrRunner; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; - -/** - * This class provides Gora Solr Test Driver to run test cases with managed schemas. - */ -public class GoraSolrManagedSchemaTestDriver extends GoraSolrTestDriver { - private static final Logger logger = LoggerFactory.getLogger(GoraSolrManagedSchemaTestDriver.class); - - //Embedded JettySolr server - JettySolrRunner solr; - - @Override - public void setUpClass() throws Exception { - solr = new JettySolrRunner("src/test/conf/solr-managed-schema","/solr", 9876); - solr.start(); - } - - @Override - public void tearDownClass() throws Exception { - if (solr != null) { - solr.stop(); - solr = null; - } - cleanupDirectoriesFailover(); - } - - /** - * Simply cleans up Solr's output from the Unit tests. - * In the case of a failure, it waits 250 msecs and tries again, 3 times in total. - */ - private void cleanupDirectoriesFailover() { - int tries = 3; - while (tries-- > 0) { - try { - cleanupDirectories(); - break; - } catch (Exception e) { - //ignore exception - try { - Thread.sleep(250); - } catch (InterruptedException e1) { - //ignore exception - } - } - } - } - - /** - * Cleans up Solr's temp base directory. - * - * @throws Exception - * if an error occurs - */ - private void cleanupDirectories() throws Exception { - File employeeDirFile = new File("src/test/conf/solr-managed-schema/Employee/data"); - File webpageDirFile = new File("src/test/conf/solr-managed-schema/WebPage/data"); - if (employeeDirFile.exists()) { - FileUtils.deleteDirectory(employeeDirFile); - } - if (webpageDirFile.exists()) { - FileUtils.deleteDirectory(webpageDirFile); - } - } - -} http://git-wip-us.apache.org/repos/asf/gora/blob/3b2f282d/gora-solr-5/src/test/java/org/apache/gora/solr/GoraSolrTestDriver.java ---------------------------------------------------------------------- diff --git a/gora-solr-5/src/test/java/org/apache/gora/solr/GoraSolrTestDriver.java b/gora-solr-5/src/test/java/org/apache/gora/solr/GoraSolrTestDriver.java deleted file mode 100644 index b022e48..0000000 --- a/gora-solr-5/src/test/java/org/apache/gora/solr/GoraSolrTestDriver.java +++ /dev/null @@ -1,92 +0,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 - * <p> - * http://www.apache.org/licenses/LICENSE-2.0 - * <p> - * 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.gora.solr; - -import org.apache.commons.io.FileUtils; -import org.apache.gora.GoraTestDriver; -import org.apache.gora.solr.store.SolrStore; -import org.apache.solr.client.solrj.embedded.JettySolrRunner; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; - -public class GoraSolrTestDriver extends GoraTestDriver { - private static final Logger logger = LoggerFactory.getLogger(GoraSolrTestDriver.class); - - //Embedded JettySolr server - JettySolrRunner solr; - - public GoraSolrTestDriver() { - super(SolrStore.class); - } - - @Override - public void setUpClass() throws Exception { - solr = new JettySolrRunner("src/test/conf/solr", "/solr", 9876); - solr.start(); - } - - @Override - public void tearDownClass() throws Exception { - if (solr != null) { - solr.stop(); - solr = null; - } - cleanupDirectoriesFailover(); - } - - /** - * Simply cleans up Solr's output from the Unit tests. - * In the case of a failure, it waits 250 msecs and tries again, 3 times in total. - */ - private void cleanupDirectoriesFailover() { - int tries = 3; - while (tries-- > 0) { - try { - cleanupDirectories(); - break; - } catch (Exception e) { - //ignore exception - try { - Thread.sleep(250); - } catch (InterruptedException e1) { - //ignore exception - } - } - } - } - - /** - * Cleans up Solr's temp base directory. - * - * @throws Exception - * if an error occurs - */ - private void cleanupDirectories() throws Exception { - File employeeDirFile = new File("src/test/conf/solr/Employee/data"); - File webpageDirFile = new File("src/test/conf/solr/WebPage/data"); - if (employeeDirFile.exists()) { - FileUtils.deleteDirectory(employeeDirFile); - } - if (webpageDirFile.exists()) { - FileUtils.deleteDirectory(webpageDirFile); - } - } - -} http://git-wip-us.apache.org/repos/asf/gora/blob/3b2f282d/gora-solr-5/src/test/java/org/apache/gora/solr/package-info.java ---------------------------------------------------------------------- diff --git a/gora-solr-5/src/test/java/org/apache/gora/solr/package-info.java b/gora-solr-5/src/test/java/org/apache/gora/solr/package-info.java deleted file mode 100644 index 1499ba1..0000000 --- a/gora-solr-5/src/test/java/org/apache/gora/solr/package-info.java +++ /dev/null @@ -1,21 +0,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. - */ -/** - * Tests for <code>gora-solr</code> including - * the test driver for {@link org.apache.gora.solr.GoraSolrTestDriver} - */ -package org.apache.gora.solr; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/gora/blob/3b2f282d/gora-solr-5/src/test/java/org/apache/gora/solr/store/TestSolrManagedSchemaStore.java ---------------------------------------------------------------------- diff --git a/gora-solr-5/src/test/java/org/apache/gora/solr/store/TestSolrManagedSchemaStore.java b/gora-solr-5/src/test/java/org/apache/gora/solr/store/TestSolrManagedSchemaStore.java deleted file mode 100644 index c997ed3..0000000 --- a/gora-solr-5/src/test/java/org/apache/gora/solr/store/TestSolrManagedSchemaStore.java +++ /dev/null @@ -1,31 +0,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. - */ -package org.apache.gora.solr.store; - -import org.apache.gora.solr.GoraSolrManagedSchemaTestDriver; - -/** - * In this class, All the test cases will run with managed schemas in Solr. - */ -public class TestSolrManagedSchemaStore extends TestSolrStore { - - static { - setTestDriver(new GoraSolrManagedSchemaTestDriver()); - } - -} http://git-wip-us.apache.org/repos/asf/gora/blob/3b2f282d/gora-solr-5/src/test/java/org/apache/gora/solr/store/package-info.java ---------------------------------------------------------------------- diff --git a/gora-solr-5/src/test/java/org/apache/gora/solr/store/package-info.java b/gora-solr-5/src/test/java/org/apache/gora/solr/store/package-info.java deleted file mode 100644 index 2b49c8b..0000000 --- a/gora-solr-5/src/test/java/org/apache/gora/solr/store/package-info.java +++ /dev/null @@ -1,21 +0,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. - */ -/** - * This package contains all the unit tests for basic CRUD operations - * functionality of the Solr dataStore. - */ -package org.apache.gora.solr.store; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/gora/blob/3b2f282d/gora-solr/pom.xml ---------------------------------------------------------------------- diff --git a/gora-solr/pom.xml b/gora-solr/pom.xml index 1a361a7..1aee88b 100644 --- a/gora-solr/pom.xml +++ b/gora-solr/pom.xml @@ -23,17 +23,18 @@ <parent> <groupId>org.apache.gora</groupId> <artifactId>gora</artifactId> - <version>0.7-SNAPSHOT</version> + <version>0.8-SNAPSHOT</version> <relativePath>../</relativePath> </parent> - <artifactId>gora-solr-4</artifactId> + <artifactId>gora-solr</artifactId> <packaging>bundle</packaging> - <name>Apache Gora :: Solr4</name> + <name>Apache Gora :: Solr</name> <properties> <osgi.import>*</osgi.import> <osgi.export>org.apache.gora.solr*;version="${project.version}";-noimport:=true</osgi.export> + <jetty.version>9.3.14.v20161028</jetty.version> </properties> <build> @@ -158,7 +159,7 @@ <dependency> <groupId>org.apache.solr</groupId> <artifactId>solr-solrj</artifactId> - <version>${lucene-solr.version}</version> + <version>${solr-solrj.version}</version> </dependency> <dependency> <groupId>com.google.guava</groupId> @@ -219,6 +220,51 @@ <artifactId>jetty-webapp</artifactId> <scope>runtime</scope> </dependency> + <dependency> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-http</artifactId> + <scope>runtime</scope> + </dependency> + <dependency> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-io</artifactId> + <scope>runtime</scope> + </dependency> + <dependency> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-deploy</artifactId> + <scope>runtime</scope> + </dependency> + <dependency> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-continuation</artifactId> + <scope>runtime</scope> + </dependency> + <dependency> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-jmx</artifactId> + <scope>runtime</scope> + </dependency> + <dependency> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-rewrite</artifactId> + <scope>runtime</scope> + </dependency> + <dependency> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-security</artifactId> + <scope>runtime</scope> + </dependency> + <dependency> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-servlets</artifactId> + <scope>runtime</scope> + </dependency> + <dependency> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-xml</artifactId> + <scope>runtime</scope> + </dependency> <!-- ADDED TO AVOID PROBLEMS WITH JAVAX --> <dependency> @@ -233,24 +279,24 @@ <artifactId>junit</artifactId> <scope>test</scope> </dependency> - <dependency> - <groupId>org.apache.solr</groupId> - <artifactId>solr-test-framework</artifactId> - <version>${lucene-solr.version}</version> - <exclusions> - <exclusion> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-servlet</artifactId> - </exclusion> - </exclusions> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.lucene</groupId> - <artifactId>lucene-test-framework</artifactId> - <version>${lucene-solr.version}</version> - <scope>test</scope> - </dependency> +<!-- <dependency> --> +<!-- <groupId>org.apache.solr</groupId> --> +<!-- <artifactId>solr-test-framework</artifactId> --> +<!-- <version>${lucene-solr-5.version}</version> --> +<!-- <exclusions> --> +<!-- <exclusion> --> +<!-- <groupId>org.eclipse.jetty</groupId> --> +<!-- <artifactId>jetty-servlet</artifactId> --> +<!-- </exclusion> --> +<!-- </exclusions> --> +<!-- <scope>test</scope> --> +<!-- </dependency> --> +<!-- <dependency> --> +<!-- <groupId>org.apache.lucene</groupId> --> +<!-- <artifactId>lucene-test-framework</artifactId> --> +<!-- <version>${lucene-solr-5.version}</version> --> +<!-- <scope>test</scope> --> +<!-- </dependency> --> </dependencies> <url>http://gora.apache.org</url> http://git-wip-us.apache.org/repos/asf/gora/blob/3b2f282d/gora-solr/src/main/java/org/apache/gora/solr/package-info.java ---------------------------------------------------------------------- diff --git a/gora-solr/src/main/java/org/apache/gora/solr/package-info.java b/gora-solr/src/main/java/org/apache/gora/solr/package-info.java new file mode 100644 index 0000000..e5531c1 --- /dev/null +++ b/gora-solr/src/main/java/org/apache/gora/solr/package-info.java @@ -0,0 +1,20 @@ +/** + * 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. + */ +/** + * This package contains Solr datastore related all classes. + */ +package org.apache.gora.solr; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/gora/blob/3b2f282d/gora-solr/src/main/java/org/apache/gora/solr/query/SolrQuery.java ---------------------------------------------------------------------- diff --git a/gora-solr/src/main/java/org/apache/gora/solr/query/SolrQuery.java b/gora-solr/src/main/java/org/apache/gora/solr/query/SolrQuery.java index b19e384..425f5c4 100644 --- a/gora-solr/src/main/java/org/apache/gora/solr/query/SolrQuery.java +++ b/gora-solr/src/main/java/org/apache/gora/solr/query/SolrQuery.java @@ -18,24 +18,42 @@ package org.apache.gora.solr.query; import org.apache.gora.persistency.impl.PersistentBase; +import org.apache.gora.query.Query; import org.apache.gora.query.impl.QueryBase; import org.apache.gora.solr.store.SolrMapping; import org.apache.gora.solr.store.SolrStore; import org.apache.gora.store.DataStore; +/** + * Solr specific implementation of the {@link Query} interface. + */ public class SolrQuery<K, T extends PersistentBase> extends QueryBase<K, T> { SolrStore<K, T> store; + /** + * Constructor for the query + */ public SolrQuery() { super(null); store = null; } - + + /** + * Constructor for the query + * + * @param dataStore Data store used + * + */ public SolrQuery(DataStore<K, T> dataStore) { super(dataStore); store = (SolrStore<K, T>)dataStore; } - + + /** + * Create a solr query + * + * @return the solr query string + */ public String toSolrQuery() { SolrMapping mapping = store.getMapping(); String fld = mapping.getPrimaryKey(); http://git-wip-us.apache.org/repos/asf/gora/blob/3b2f282d/gora-solr/src/main/java/org/apache/gora/solr/query/SolrResult.java ---------------------------------------------------------------------- diff --git a/gora-solr/src/main/java/org/apache/gora/solr/query/SolrResult.java b/gora-solr/src/main/java/org/apache/gora/solr/query/SolrResult.java index 38c1fca..d3ef88a 100644 --- a/gora-solr/src/main/java/org/apache/gora/solr/query/SolrResult.java +++ b/gora-solr/src/main/java/org/apache/gora/solr/query/SolrResult.java @@ -27,7 +27,7 @@ import org.apache.gora.query.impl.PartitionQueryImpl; import org.apache.gora.query.impl.ResultBase; import org.apache.gora.solr.store.SolrStore; import org.apache.gora.store.DataStore; -import org.apache.solr.client.solrj.SolrServer; +import org.apache.solr.client.solrj.SolrClient; import org.apache.solr.client.solrj.SolrServerException; import org.apache.solr.client.solrj.response.QueryResponse; import org.apache.solr.common.SolrDocument; @@ -35,6 +35,10 @@ import org.apache.solr.common.SolrDocumentList; import org.apache.solr.common.params.CommonParams; import org.apache.solr.common.params.ModifiableSolrParams; +/** + * SolrResult specific implementation of the {@link org.apache.gora.query.Result} + * interface. + */ public class SolrResult<K, T extends PersistentBase> extends ResultBase<K, T> { SolrDocumentList list = null; @@ -42,8 +46,16 @@ public class SolrResult<K, T extends PersistentBase> extends ResultBase<K, T> { String[] fields; int pos = 0; + /** + * Constructor for the result set + * + * @param dataStore Data store used + * @param query Query used + * @param server A client that talks directly to a Solr server + * @param resultsSize The number of rows to be returned + */ public SolrResult(DataStore<K, T> dataStore, Query<K, T> query, - SolrServer server, int resultsSize) throws IOException { + SolrClient server, int resultsSize) throws IOException { super(dataStore, query); store = (SolrStore<K, T>)dataStore; ModifiableSolrParams params = new ModifiableSolrParams(); @@ -75,6 +87,9 @@ public class SolrResult<K, T extends PersistentBase> extends ResultBase<K, T> { } } + /** + * Gets the next item + */ @SuppressWarnings("unchecked") @Override protected boolean nextInner() throws IOException { @@ -92,6 +107,9 @@ public class SolrResult<K, T extends PersistentBase> extends ResultBase<K, T> { if (list != null) list.clear(); } + /** + * Gets the items reading progress + */ @Override public float getProgress() throws IOException { if (list != null && list.size() > 0) { http://git-wip-us.apache.org/repos/asf/gora/blob/3b2f282d/gora-solr/src/main/java/org/apache/gora/solr/query/package-info.java ---------------------------------------------------------------------- diff --git a/gora-solr/src/main/java/org/apache/gora/solr/query/package-info.java b/gora-solr/src/main/java/org/apache/gora/solr/query/package-info.java new file mode 100644 index 0000000..92f6bf5 --- /dev/null +++ b/gora-solr/src/main/java/org/apache/gora/solr/query/package-info.java @@ -0,0 +1,21 @@ +/** + * 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. + */ +/** + * This package contains all the Solr store query representation class as well as Result set representing class + * when query is executed over the Solr dataStore. + */ +package org.apache.gora.solr.query; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/gora/blob/3b2f282d/gora-solr/src/main/java/org/apache/gora/solr/store/SolrMapping.java ---------------------------------------------------------------------- diff --git a/gora-solr/src/main/java/org/apache/gora/solr/store/SolrMapping.java b/gora-solr/src/main/java/org/apache/gora/solr/store/SolrMapping.java index 424ae71..635b426 100644 --- a/gora-solr/src/main/java/org/apache/gora/solr/store/SolrMapping.java +++ b/gora-solr/src/main/java/org/apache/gora/solr/store/SolrMapping.java @@ -19,6 +19,9 @@ package org.apache.gora.solr.store; import java.util.HashMap; +/** + * Mapping definitions for Solr. + */ public class SolrMapping { HashMap<String,String> mapping; String coreName; http://git-wip-us.apache.org/repos/asf/gora/blob/3b2f282d/gora-solr/src/main/java/org/apache/gora/solr/store/SolrStore.java ---------------------------------------------------------------------- diff --git a/gora-solr/src/main/java/org/apache/gora/solr/store/SolrStore.java b/gora-solr/src/main/java/org/apache/gora/solr/store/SolrStore.java index 350baef..ac44a06 100644 --- a/gora-solr/src/main/java/org/apache/gora/solr/store/SolrStore.java +++ b/gora-solr/src/main/java/org/apache/gora/solr/store/SolrStore.java @@ -17,9 +17,11 @@ package org.apache.gora.solr.store; import java.io.IOException; import java.net.MalformedURLException; import java.nio.ByteBuffer; +import java.util.Arrays; import java.util.ArrayList; import java.util.List; import java.util.Locale; +import java.util.HashMap; import java.util.Map; import java.util.Properties; import java.util.concurrent.ConcurrentHashMap; @@ -44,9 +46,13 @@ import org.apache.gora.util.AvroUtils; import org.apache.gora.util.IOUtils; import org.apache.hadoop.util.StringUtils; import org.apache.http.impl.client.DefaultHttpClient; -import org.apache.solr.client.solrj.SolrServer; +import org.apache.solr.client.solrj.SolrClient; import org.apache.solr.client.solrj.SolrServerException; -import org.apache.solr.client.solrj.impl.*; +import org.apache.solr.client.solrj.impl.CloudSolrClient; +import org.apache.solr.client.solrj.impl.ConcurrentUpdateSolrClient; +import org.apache.solr.client.solrj.impl.HttpClientUtil; +import org.apache.solr.client.solrj.impl.HttpSolrClient; +import org.apache.solr.client.solrj.impl.LBHttpSolrClient; import org.apache.solr.client.solrj.request.CoreAdminRequest; import org.apache.solr.client.solrj.response.CoreAdminResponse; import org.apache.solr.client.solrj.response.QueryResponse; @@ -61,6 +67,12 @@ import org.jdom.input.SAXBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +/** + * Implementation of a Solr data store to be used by gora. + * + * @param <K> class to be used for the key + * @param <T> class to be persisted within the store + */ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K, T> { private static final Logger LOG = LoggerFactory.getLogger(SolrStore.class); @@ -83,7 +95,7 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K, T> */ protected static final String SOLR_BATCH_SIZE_PROPERTY = "solr.batch_size"; - /** The solrj implementation to use. This has a default value of <i>http</i> for HttpSolrServer. + /** The solrj implementation to use. This has a default value of <i>http</i> for HttpSolrClient. * Available options include <b>http</b>, <b>cloud</b>, <b>concurrent</b> and <b>loadbalance</b>. * Defined in <code>gora.properties</code> * This value must be of type <b>String</b>. @@ -143,9 +155,9 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K, T> private SolrMapping mapping; - private String solrServerUrl, solrConfig, solrSchema, solrJServerImpl; + private String SolrClientUrl, solrConfig, solrSchema, solrJServerImpl; - private SolrServer server, adminServer; + private SolrClient server, adminServer; private boolean serverUserAuth; @@ -178,6 +190,15 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K, T> public static final ConcurrentHashMap<Schema, SpecificDatumWriter<?>> writerMap = new ConcurrentHashMap<>(); + /** + * Initialize the data store by reading the credentials, setting the client's properties up and + * reading the mapping file. Initialize is called when then the call to + * {@link org.apache.gora.store.DataStoreFactory#createDataStore} is made. + * + * @param keyClass + * @param persistentClass + * @param properties + */ @Override public void initialize(Class<K> keyClass, Class<T> persistentClass, Properties properties) { @@ -190,7 +211,7 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K, T> LOG.error(e.getMessage(), e); } - solrServerUrl = DataStoreFactory.findProperty(properties, this, + SolrClientUrl = DataStoreFactory.findProperty(properties, this, SOLR_URL_PROPERTY, null); solrConfig = DataStoreFactory.findProperty(properties, this, SOLR_CONFIG_PROPERTY, null); @@ -206,60 +227,60 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K, T> serverPassword = DataStoreFactory.findProperty(properties, this, SOLR_SERVER_PASSWORD, null); } - LOG.info("Using Solr server at " + solrServerUrl); + LOG.info("Using Solr server at " + SolrClientUrl); String solrJServerType = ((solrJServerImpl == null || solrJServerImpl.equals(""))?"http":solrJServerImpl); - // HttpSolrServer - denoted by "http" in properties + // HttpSolrClient - denoted by "http" in properties if (solrJServerType.toLowerCase(Locale.getDefault()).equals("http")) { - LOG.info("Using HttpSolrServer Solrj implementation."); - this.adminServer = new HttpSolrServer(solrServerUrl); - this.server = new HttpSolrServer( solrServerUrl + "/" + mapping.getCoreName() ); + LOG.info("Using HttpSolrClient Solrj implementation."); + this.adminServer = new HttpSolrClient(SolrClientUrl); + this.server = new HttpSolrClient( SolrClientUrl + "/" + mapping.getCoreName() ); if (serverUserAuth) { HttpClientUtil.setBasicAuth( - (DefaultHttpClient) ((HttpSolrServer) adminServer).getHttpClient(), + (DefaultHttpClient) ((HttpSolrClient) adminServer).getHttpClient(), serverUsername, serverPassword); HttpClientUtil.setBasicAuth( - (DefaultHttpClient) ((HttpSolrServer) server).getHttpClient(), + (DefaultHttpClient) ((HttpSolrClient) server).getHttpClient(), serverUsername, serverPassword); } - // CloudSolrServer - denoted by "cloud" in properties + // CloudSolrClient - denoted by "cloud" in properties } else if (solrJServerType.toLowerCase(Locale.getDefault()).equals("cloud")) { - LOG.info("Using CloudSolrServer Solrj implementation."); - this.adminServer = new CloudSolrServer(solrServerUrl); - this.server = new CloudSolrServer( solrServerUrl + "/" + mapping.getCoreName() ); + LOG.info("Using CloudSolrClient Solrj implementation."); + this.adminServer = new CloudSolrClient(SolrClientUrl); + this.server = new CloudSolrClient( SolrClientUrl + "/" + mapping.getCoreName() ); if (serverUserAuth) { HttpClientUtil.setBasicAuth( - (DefaultHttpClient) ((CloudSolrServer) adminServer).getLbServer().getHttpClient(), + (DefaultHttpClient) ((CloudSolrClient) adminServer).getLbClient().getHttpClient(), serverUsername, serverPassword); HttpClientUtil.setBasicAuth( - (DefaultHttpClient) ((CloudSolrServer) server).getLbServer().getHttpClient(), + (DefaultHttpClient) ((CloudSolrClient) server).getLbClient().getHttpClient(), serverUsername, serverPassword); } } else if (solrJServerType.toLowerCase(Locale.getDefault()).equals("concurrent")) { - LOG.info("Using ConcurrentUpdateSolrServer Solrj implementation."); - this.adminServer = new ConcurrentUpdateSolrServer(solrServerUrl, 1000, 10); - this.server = new ConcurrentUpdateSolrServer( solrServerUrl + "/" + mapping.getCoreName(), 1000, 10); - // LBHttpSolrServer - denoted by "loadbalance" in properties + LOG.info("Using ConcurrentUpdateSolrClient Solrj implementation."); + this.adminServer = new ConcurrentUpdateSolrClient(SolrClientUrl, 1000, 10); + this.server = new ConcurrentUpdateSolrClient( SolrClientUrl + "/" + mapping.getCoreName(), 1000, 10); + // LBHttpSolrClient - denoted by "loadbalance" in properties } else if (solrJServerType.toLowerCase(Locale.getDefault()).equals("loadbalance")) { - LOG.info("Using LBHttpSolrServer Solrj implementation."); - String[] solrUrlElements = StringUtils.split(solrServerUrl); + LOG.info("Using LBHttpSolrClient Solrj implementation."); + String[] solrUrlElements = StringUtils.split(SolrClientUrl); try { - this.adminServer = new LBHttpSolrServer(solrUrlElements); + this.adminServer = new LBHttpSolrClient(solrUrlElements); } catch (MalformedURLException e) { LOG.error(e.getMessage()); throw new RuntimeException(e); } try { - this.server = new LBHttpSolrServer( solrUrlElements + "/" + mapping.getCoreName() ); + this.server = new LBHttpSolrClient( solrUrlElements + "/" + mapping.getCoreName() ); } catch (MalformedURLException e) { LOG.error(e.getMessage()); throw new RuntimeException(e); } if (serverUserAuth) { HttpClientUtil.setBasicAuth( - (DefaultHttpClient) ((LBHttpSolrServer) adminServer).getHttpClient(), + (DefaultHttpClient) ((LBHttpSolrClient) adminServer).getHttpClient(), serverUsername, serverPassword); HttpClientUtil.setBasicAuth( - (DefaultHttpClient) ((LBHttpSolrServer) server).getHttpClient(), + (DefaultHttpClient) ((LBHttpSolrClient) server).getHttpClient(), serverUsername, serverPassword); } } @@ -722,11 +743,41 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K, T> @Override public long deleteByQuery(Query<K, T> query) { - String q = ((SolrQuery<K, T>) query).toSolrQuery(); + UpdateResponse rsp; try { - UpdateResponse rsp = server.deleteByQuery(q); - server.commit(); - LOG.info(rsp.toString()); + /* + In this If block we check whether, user needs to delete full document or some fields in the document. We can't delete fields in a document by using solr deleteByQuery method. + therefore what we have done here is setting the particular fields values into null. + */ + if (query.getFields() != null && query.getFields().length < mapping.mapping.size() && !(Arrays.asList(query.getFields()).contains(mapping.getPrimaryKey()))) { + Result<K, T> result = query.execute(); + Map<String, String> partialUpdateNull = new HashMap<>(); + partialUpdateNull.put("set", null); + while (result.next()) { + SolrInputDocument inputDoc = new SolrInputDocument(); + inputDoc.setField(mapping.getPrimaryKey(), result.getKey()); + for (String field : query.getFields()) { + inputDoc.setField(field, partialUpdateNull); + } + batch.add(inputDoc); + } + if (commitWithin == 0) { + rsp = server.add(batch); + server.commit(false, true, true); + batch.clear(); + LOG.info(rsp.toString()); + } else { + rsp = server.add(batch, commitWithin); + batch.clear(); + LOG.info(rsp.toString()); + } + } else { + SolrQuery<K, T> solrQuery = (SolrQuery<K, T>) query; + String q = solrQuery.toSolrQuery(); + rsp = server.deleteByQuery(q); + server.commit(); + LOG.info(rsp.toString()); + } } catch (Exception e) { LOG.error(e.getMessage(), e); } http://git-wip-us.apache.org/repos/asf/gora/blob/3b2f282d/gora-solr/src/main/java/org/apache/gora/solr/store/package-info.java ---------------------------------------------------------------------- diff --git a/gora-solr/src/main/java/org/apache/gora/solr/store/package-info.java b/gora-solr/src/main/java/org/apache/gora/solr/store/package-info.java new file mode 100644 index 0000000..7ae4275 --- /dev/null +++ b/gora-solr/src/main/java/org/apache/gora/solr/store/package-info.java @@ -0,0 +1,20 @@ +/** + * 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. + */ +/** + * This package contains all the Solr store related classes. + */ +package org.apache.gora.solr.store; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/gora/blob/3b2f282d/gora-solr/src/test/conf/solr-managed-schema/Employee/conf/elevate.xml ---------------------------------------------------------------------- diff --git a/gora-solr/src/test/conf/solr-managed-schema/Employee/conf/elevate.xml b/gora-solr/src/test/conf/solr-managed-schema/Employee/conf/elevate.xml new file mode 100644 index 0000000..ed6a886 --- /dev/null +++ b/gora-solr/src/test/conf/solr-managed-schema/Employee/conf/elevate.xml @@ -0,0 +1,42 @@ +<?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. +--> + +<!-- If this file is found in the config directory, it will only be + loaded once at startup. If it is found in Solr's data + directory, it will be re-loaded every commit. + + See http://wiki.apache.org/solr/QueryElevationComponent for more info + +--> +<elevate> + <!-- Query elevation examples + <query text="foo bar"> + <doc id="1" /> + <doc id="2" /> + <doc id="3" /> + </query> + +for use with techproducts example + + <query text="ipod"> + <doc id="MA147LL/A" /> put the actual ipod at the top + <doc id="IW-02" exclude="true" /> exclude this cable + </query> +--> + +</elevate> http://git-wip-us.apache.org/repos/asf/gora/blob/3b2f282d/gora-solr/src/test/conf/solr-managed-schema/Employee/conf/lang/stopwords_en.txt ---------------------------------------------------------------------- diff --git a/gora-solr/src/test/conf/solr-managed-schema/Employee/conf/lang/stopwords_en.txt b/gora-solr/src/test/conf/solr-managed-schema/Employee/conf/lang/stopwords_en.txt new file mode 100644 index 0000000..224230c --- /dev/null +++ b/gora-solr/src/test/conf/solr-managed-schema/Employee/conf/lang/stopwords_en.txt @@ -0,0 +1,54 @@ +# 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. + +# a couple of test stopwords to test that the words are really being +# configured from this file: +stopworda +stopwordb + +# Standard english stop words taken from Lucene's StopAnalyzer +a +an +and +are +as +at +be +but +by +for +if +in +into +is +it +no +not +of +on +or +such +that +the +their +then +there +these +they +this +to +was +will +with http://git-wip-us.apache.org/repos/asf/gora/blob/3b2f282d/gora-solr/src/test/conf/solr-managed-schema/Employee/conf/managed-schema ---------------------------------------------------------------------- diff --git a/gora-solr/src/test/conf/solr-managed-schema/Employee/conf/managed-schema b/gora-solr/src/test/conf/solr-managed-schema/Employee/conf/managed-schema new file mode 100644 index 0000000..83c296f --- /dev/null +++ b/gora-solr/src/test/conf/solr-managed-schema/Employee/conf/managed-schema @@ -0,0 +1,33 @@ +<?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. +--> + +<!-- Solr managed schema - automatically generated - DO NOT EDIT --> +<schema name="test example Employee" version="1.5"> + <uniqueKey>ssn</uniqueKey> + <fieldType name="binary" class="solr.BinaryField"/> + <fieldType name="int" class="solr.TrieIntField" positionIncrementGap="0" precisionStep="0"/> + <fieldType name="long" class="solr.TrieLongField" positionIncrementGap="0" precisionStep="0"/> + <fieldType name="string" class="solr.StrField" sortMissingLast="true"/> + <field name="_version_" type="long" indexed="true" stored="true"/> + <field name="boss" type="binary" stored="true"/> + <field name="dateOfBirth" type="long" stored="true"/> + <field name="name" type="string" indexed="true" stored="true"/> + <field name="salary" type="int" stored="true"/> + <field name="ssn" type="string" multiValued="false" indexed="true" required="true" stored="true"/> + <field name="webpage" type="binary" stored="true"/> +</schema> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/gora/blob/3b2f282d/gora-solr/src/test/conf/solr-managed-schema/Employee/conf/protwords.txt ---------------------------------------------------------------------- diff --git a/gora-solr/src/test/conf/solr-managed-schema/Employee/conf/protwords.txt b/gora-solr/src/test/conf/solr-managed-schema/Employee/conf/protwords.txt new file mode 100644 index 0000000..5a32e50 --- /dev/null +++ b/gora-solr/src/test/conf/solr-managed-schema/Employee/conf/protwords.txt @@ -0,0 +1,21 @@ +# 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. + +#----------------------------------------------------------------------- +# Use a protected word file to protect against the stemmer reducing two +# unrelated words to the same base word. + +# Some non-words that normally won't be encountered, +# just to test that they won't be stemmed. +dontstems +zwhacky +