You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2023/04/26 11:18:13 UTC
[camel] 01/03: CAMEL-19290 - camel-solr - Remove component as its not maintainable
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 3625f5ab705e334137db722ab058c5cd6e612cbb
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Apr 26 11:34:07 2023 +0200
CAMEL-19290 - camel-solr - Remove component as its not maintainable
Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
components/camel-solr/pom.xml | 198 ---
.../component/solr/SolrComponentConfigurer.java | 55 -
.../component/solr/SolrEndpointConfigurer.java | 148 --
.../component/solr/SolrEndpointUriFactory.java | 96 -
.../services/org/apache/camel/component.properties | 7 -
.../services/org/apache/camel/component/solr | 2 -
.../services/org/apache/camel/component/solrCloud | 2 -
.../services/org/apache/camel/component/solrs | 2 -
.../org/apache/camel/configurer/solr-component | 2 -
.../org/apache/camel/configurer/solr-endpoint | 2 -
.../org/apache/camel/urifactory/solr-endpoint | 2 -
.../org/apache/camel/urifactory/solrCloud-endpoint | 2 -
.../org/apache/camel/urifactory/solrs-endpoint | 2 -
.../org/apache/camel/component/solr/solr.json | 58 -
.../org/apache/camel/component/solr/solrCloud.json | 58 -
.../org/apache/camel/component/solr/solrs.json | 58 -
.../camel-solr/src/main/docs/solr-component.adoc | 169 --
.../camel/component/solr/SolrClientHandler.java | 154 --
.../component/solr/SolrClientHandlerCloud.java | 53 -
.../solr/SolrClientHandlerConcurrentUpdate.java | 45 -
.../component/solr/SolrClientHandlerHttp.java | 49 -
.../component/solr/SolrClientHandlerLbHttp.java | 45 -
.../apache/camel/component/solr/SolrComponent.java | 121 --
.../camel/component/solr/SolrConfiguration.java | 389 ----
.../apache/camel/component/solr/SolrConstants.java | 54 -
.../apache/camel/component/solr/SolrEndpoint.java | 97 -
.../apache/camel/component/solr/SolrProducer.java | 302 ----
.../camel/component/solr/InitSolrEndpointTest.java | 138 --
.../camel/component/solr/JettySolrFactory.java | 139 --
.../camel/component/solr/MapBodyManualIT.java | 77 -
.../camel/component/solr/SolrAddBeanTest.java | 48 -
.../camel/component/solr/SolrAddBeansTest.java | 62 -
.../camel/component/solr/SolrCloudFixture.java | 173 --
.../component/solr/SolrComponentTestSupport.java | 131 --
.../camel/component/solr/SolrDeleteTest.java | 77 -
.../apache/camel/component/solr/SolrFixtures.java | 136 --
.../component/solr/SolrServerMissingTest.java | 47 -
.../camel/component/solr/SolrTestSupport.java | 44 -
.../camel/component/solr/SolrTransactionsTest.java | 107 --
.../component/solr/SolrUpdateAutocommitTest.java | 340 ----
.../camel/component/solr/SolrUpdateTest.java | 364 ----
.../solr/integration/SolrCloudITSupport.java | 62 -
.../solr/integration/SolrCloudProducerIT.java | 41 -
.../component/solr/integration/SolrITSupport.java | 42 -
.../camel-solr/src/test/resources/data/books.csv | 11 -
.../camel-solr/src/test/resources/data/books.xml | 68 -
.../src/test/resources/data/tutorial.pdf | Bin 53264 -> 0 bytes
.../src/test/resources/log4j2.properties | 30 -
.../resources/solr/collection1/conf/elevate.xml | 37 -
.../resources/solr/collection1/conf/protwords.txt | 21 -
.../resources/solr/collection1/conf/schema.xml | 639 -------
.../resources/solr/collection1/conf/scripts.conf | 24 -
.../resources/solr/collection1/conf/solrconfig.xml | 1818 -------------------
.../resources/solr/collection1/conf/spellings.txt | 2 -
.../resources/solr/collection1/conf/stopwords.txt | 14 -
.../solr/collection1/conf/stopwords_en.txt | 54 -
.../resources/solr/collection1/conf/synonyms.txt | 29 -
.../resources/solr/collection1/core.properties | 19 -
.../resources/solr/conf/collection1/elevate.xml | 37 -
.../resources/solr/conf/collection1/protwords.txt | 21 -
.../resources/solr/conf/collection1/schema.xml | 643 -------
.../resources/solr/conf/collection1/scripts.conf | 24 -
.../resources/solr/conf/collection1/solrconfig.xml | 1872 --------------------
.../resources/solr/conf/collection1/spellings.txt | 2 -
.../resources/solr/conf/collection1/stopwords.txt | 14 -
.../solr/conf/collection1/stopwords_en.txt | 54 -
.../resources/solr/conf/collection1/synonyms.txt | 29 -
.../src/test/resources/solr/security.json | 13 -
.../src/test/resources/solr/solr-no-core.xml | 35 -
.../camel-solr/src/test/resources/solr/solr.xml | 40 -
.../src/test/resources/solrtest.keystore | Bin 2208 -> 0 bytes
components/pom.xml | 1 -
72 files changed, 9751 deletions(-)
diff --git a/components/camel-solr/pom.xml b/components/camel-solr/pom.xml
deleted file mode 100644
index 68cd05079f0..00000000000
--- a/components/camel-solr/pom.xml
+++ /dev/null
@@ -1,198 +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.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>components</artifactId>
- <groupId>org.apache.camel</groupId>
- <version>4.0.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>camel-solr</artifactId>
- <packaging>jar</packaging>
- <name>Camel :: Solr</name>
- <description>Camel Solr Support</description>
-
- <properties>
- <java.awt.headless>true</java.awt.headless>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-support</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-attachments</artifactId>
- </dependency>
- <dependency>
- <groupId>org.eclipse.angus</groupId>
- <artifactId>angus-mail</artifactId>
- <version>${angus-mail-version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.solr</groupId>
- <artifactId>solr-solrj</artifactId>
- <version>${solr-version}</version>
- </dependency>
- <dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- <version>${commons-codec-version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient</artifactId>
- <version>${httpclient4-version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpmime</artifactId>
- <version>${httpclient4-version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.zookeeper</groupId>
- <artifactId>zookeeper</artifactId>
- <version>${solr-zookeeper-version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <!-- test dependencies -->
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-test-junit5</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.solr</groupId>
- <artifactId>solr-test-framework</artifactId>
- <version>${solr-version}</version>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>com.google.protobuf</groupId>
- <artifactId>protobuf-java</artifactId>
- </exclusion>
- <!-- exclude rome 0.9 which is not a valid Maven artifact -->
- <!-- rome is not a needed dependency -->
- <exclusion>
- <groupId>rome</groupId>
- <artifactId>rome</artifactId>
- </exclusion>
- <exclusion>
- <groupId>jdk.tools</groupId>
- <artifactId>jdk.tools</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>com.google.protobuf</groupId>
- <artifactId>protobuf-java</artifactId>
- <version>${protobuf-version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.solr</groupId>
- <artifactId>solr-cell</artifactId>
- <version>${solr-version}</version>
- <scope>test</scope>
- <exclusions>
- <!-- exclude rome 0.9 which is not a valid Maven artifact -->
- <!-- rome is not a needed dependency -->
- <exclusion>
- <groupId>rome</groupId>
- <artifactId>rome</artifactId>
- </exclusion>
- <exclusion>
- <groupId>jdk.tools</groupId>
- <artifactId>jdk.tools</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-server</artifactId>
- <version>9.4.44.v20210927</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-servlet</artifactId>
- <version>9.4.44.v20210927</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</artifactId>
- <version>${xml-apis-version}</version>
- <scope>test</scope>
- </dependency>
- <!-- test infra -->
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-test-infra-solr</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-slf4j-impl</artifactId>
- <version>${log4j2-version}</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <plugins>
- <!-- clean the data directory before installing -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>auto-clean</id>
- <phase>install</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <target>
- <delete dir="${basedir}/data" quiet="true" />
- </target>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/components/camel-solr/src/generated/java/org/apache/camel/component/solr/SolrComponentConfigurer.java b/components/camel-solr/src/generated/java/org/apache/camel/component/solr/SolrComponentConfigurer.java
deleted file mode 100644
index 58ff73ff20a..00000000000
--- a/components/camel-solr/src/generated/java/org/apache/camel/component/solr/SolrComponentConfigurer.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.component.solr;
-
-import java.util.Map;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.spi.ExtendedPropertyConfigurerGetter;
-import org.apache.camel.spi.PropertyConfigurerGetter;
-import org.apache.camel.spi.ConfigurerStrategy;
-import org.apache.camel.spi.GeneratedPropertyConfigurer;
-import org.apache.camel.util.CaseInsensitiveMap;
-import org.apache.camel.support.component.PropertyConfigurerSupport;
-
-/**
- * Generated by camel build tools - do NOT edit this file!
- */
-@SuppressWarnings("unchecked")
-public class SolrComponentConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
-
- @Override
- public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
- SolrComponent target = (SolrComponent) obj;
- switch (ignoreCase ? name.toLowerCase() : name) {
- case "autowiredenabled":
- case "autowiredEnabled": target.setAutowiredEnabled(property(camelContext, boolean.class, value)); return true;
- case "lazystartproducer":
- case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
- default: return false;
- }
- }
-
- @Override
- public Class<?> getOptionType(String name, boolean ignoreCase) {
- switch (ignoreCase ? name.toLowerCase() : name) {
- case "autowiredenabled":
- case "autowiredEnabled": return boolean.class;
- case "lazystartproducer":
- case "lazyStartProducer": return boolean.class;
- default: return null;
- }
- }
-
- @Override
- public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
- SolrComponent target = (SolrComponent) obj;
- switch (ignoreCase ? name.toLowerCase() : name) {
- case "autowiredenabled":
- case "autowiredEnabled": return target.isAutowiredEnabled();
- case "lazystartproducer":
- case "lazyStartProducer": return target.isLazyStartProducer();
- default: return null;
- }
- }
-}
-
diff --git a/components/camel-solr/src/generated/java/org/apache/camel/component/solr/SolrEndpointConfigurer.java b/components/camel-solr/src/generated/java/org/apache/camel/component/solr/SolrEndpointConfigurer.java
deleted file mode 100644
index d8b78a16494..00000000000
--- a/components/camel-solr/src/generated/java/org/apache/camel/component/solr/SolrEndpointConfigurer.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.component.solr;
-
-import java.util.Map;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.spi.ExtendedPropertyConfigurerGetter;
-import org.apache.camel.spi.PropertyConfigurerGetter;
-import org.apache.camel.spi.ConfigurerStrategy;
-import org.apache.camel.spi.GeneratedPropertyConfigurer;
-import org.apache.camel.util.CaseInsensitiveMap;
-import org.apache.camel.support.component.PropertyConfigurerSupport;
-
-/**
- * Generated by camel build tools - do NOT edit this file!
- */
-@SuppressWarnings("unchecked")
-public class SolrEndpointConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
-
- @Override
- public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
- SolrEndpoint target = (SolrEndpoint) obj;
- switch (ignoreCase ? name.toLowerCase() : name) {
- case "allowcompression":
- case "allowCompression": target.getSolrConfiguration().setAllowCompression(property(camelContext, java.lang.Boolean.class, value)); return true;
- case "autocommit":
- case "autoCommit": target.getSolrConfiguration().setAutoCommit(property(camelContext, boolean.class, value)); return true;
- case "collection": target.getSolrConfiguration().setCollection(property(camelContext, java.lang.String.class, value)); return true;
- case "connectiontimeout":
- case "connectionTimeout": target.getSolrConfiguration().setConnectionTimeout(property(camelContext, java.lang.Integer.class, value)); return true;
- case "defaultmaxconnectionsperhost":
- case "defaultMaxConnectionsPerHost": target.getSolrConfiguration().setDefaultMaxConnectionsPerHost(property(camelContext, java.lang.Integer.class, value)); return true;
- case "followredirects":
- case "followRedirects": target.getSolrConfiguration().setFollowRedirects(property(camelContext, java.lang.Boolean.class, value)); return true;
- case "httpclient":
- case "httpClient": target.getSolrConfiguration().setHttpClient(property(camelContext, org.apache.http.client.HttpClient.class, value)); return true;
- case "lazystartproducer":
- case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
- case "maxretries":
- case "maxRetries": target.getSolrConfiguration().setMaxRetries(property(camelContext, java.lang.Integer.class, value)); return true;
- case "maxtotalconnections":
- case "maxTotalConnections": target.getSolrConfiguration().setMaxTotalConnections(property(camelContext, java.lang.Integer.class, value)); return true;
- case "password": target.getSolrConfiguration().setPassword(property(camelContext, java.lang.String.class, value)); return true;
- case "requesthandler":
- case "requestHandler": target.getSolrConfiguration().setRequestHandler(property(camelContext, java.lang.String.class, value)); return true;
- case "sotimeout":
- case "soTimeout": target.getSolrConfiguration().setSoTimeout(property(camelContext, java.lang.Integer.class, value)); return true;
- case "solrclient":
- case "solrClient": target.getSolrConfiguration().setSolrClient(property(camelContext, org.apache.solr.client.solrj.SolrClient.class, value)); return true;
- case "streamingqueuesize":
- case "streamingQueueSize": target.getSolrConfiguration().setStreamingQueueSize(property(camelContext, int.class, value)); return true;
- case "streamingthreadcount":
- case "streamingThreadCount": target.getSolrConfiguration().setStreamingThreadCount(property(camelContext, int.class, value)); return true;
- case "username": target.getSolrConfiguration().setUsername(property(camelContext, java.lang.String.class, value)); return true;
- case "zkchroot":
- case "zkChroot": target.getSolrConfiguration().setZkChroot(property(camelContext, java.lang.String.class, value)); return true;
- case "zkhost":
- case "zkHost": target.getSolrConfiguration().setZkHost(property(camelContext, java.lang.String.class, value)); return true;
- default: return false;
- }
- }
-
- @Override
- public Class<?> getOptionType(String name, boolean ignoreCase) {
- switch (ignoreCase ? name.toLowerCase() : name) {
- case "allowcompression":
- case "allowCompression": return java.lang.Boolean.class;
- case "autocommit":
- case "autoCommit": return boolean.class;
- case "collection": return java.lang.String.class;
- case "connectiontimeout":
- case "connectionTimeout": return java.lang.Integer.class;
- case "defaultmaxconnectionsperhost":
- case "defaultMaxConnectionsPerHost": return java.lang.Integer.class;
- case "followredirects":
- case "followRedirects": return java.lang.Boolean.class;
- case "httpclient":
- case "httpClient": return org.apache.http.client.HttpClient.class;
- case "lazystartproducer":
- case "lazyStartProducer": return boolean.class;
- case "maxretries":
- case "maxRetries": return java.lang.Integer.class;
- case "maxtotalconnections":
- case "maxTotalConnections": return java.lang.Integer.class;
- case "password": return java.lang.String.class;
- case "requesthandler":
- case "requestHandler": return java.lang.String.class;
- case "sotimeout":
- case "soTimeout": return java.lang.Integer.class;
- case "solrclient":
- case "solrClient": return org.apache.solr.client.solrj.SolrClient.class;
- case "streamingqueuesize":
- case "streamingQueueSize": return int.class;
- case "streamingthreadcount":
- case "streamingThreadCount": return int.class;
- case "username": return java.lang.String.class;
- case "zkchroot":
- case "zkChroot": return java.lang.String.class;
- case "zkhost":
- case "zkHost": return java.lang.String.class;
- default: return null;
- }
- }
-
- @Override
- public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
- SolrEndpoint target = (SolrEndpoint) obj;
- switch (ignoreCase ? name.toLowerCase() : name) {
- case "allowcompression":
- case "allowCompression": return target.getSolrConfiguration().getAllowCompression();
- case "autocommit":
- case "autoCommit": return target.getSolrConfiguration().isAutoCommit();
- case "collection": return target.getSolrConfiguration().getCollection();
- case "connectiontimeout":
- case "connectionTimeout": return target.getSolrConfiguration().getConnectionTimeout();
- case "defaultmaxconnectionsperhost":
- case "defaultMaxConnectionsPerHost": return target.getSolrConfiguration().getDefaultMaxConnectionsPerHost();
- case "followredirects":
- case "followRedirects": return target.getSolrConfiguration().getFollowRedirects();
- case "httpclient":
- case "httpClient": return target.getSolrConfiguration().getHttpClient();
- case "lazystartproducer":
- case "lazyStartProducer": return target.isLazyStartProducer();
- case "maxretries":
- case "maxRetries": return target.getSolrConfiguration().getMaxRetries();
- case "maxtotalconnections":
- case "maxTotalConnections": return target.getSolrConfiguration().getMaxTotalConnections();
- case "password": return target.getSolrConfiguration().getPassword();
- case "requesthandler":
- case "requestHandler": return target.getSolrConfiguration().getRequestHandler();
- case "sotimeout":
- case "soTimeout": return target.getSolrConfiguration().getSoTimeout();
- case "solrclient":
- case "solrClient": return target.getSolrConfiguration().getSolrClient();
- case "streamingqueuesize":
- case "streamingQueueSize": return target.getSolrConfiguration().getStreamingQueueSize();
- case "streamingthreadcount":
- case "streamingThreadCount": return target.getSolrConfiguration().getStreamingThreadCount();
- case "username": return target.getSolrConfiguration().getUsername();
- case "zkchroot":
- case "zkChroot": return target.getSolrConfiguration().getZkChroot();
- case "zkhost":
- case "zkHost": return target.getSolrConfiguration().getZkHost();
- default: return null;
- }
- }
-}
-
diff --git a/components/camel-solr/src/generated/java/org/apache/camel/component/solr/SolrEndpointUriFactory.java b/components/camel-solr/src/generated/java/org/apache/camel/component/solr/SolrEndpointUriFactory.java
deleted file mode 100644
index 8ac339f31f3..00000000000
--- a/components/camel-solr/src/generated/java/org/apache/camel/component/solr/SolrEndpointUriFactory.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.component.solr;
-
-import java.net.URISyntaxException;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.camel.spi.EndpointUriFactory;
-
-/**
- * Generated by camel build tools - do NOT edit this file!
- */
-public class SolrEndpointUriFactory extends org.apache.camel.support.component.EndpointUriFactorySupport implements EndpointUriFactory {
-
- private static final String BASE = ":url";
- private static final String[] SCHEMES = new String[]{"solr", "solrs", "solrCloud"};
-
- private static final Set<String> PROPERTY_NAMES;
- private static final Set<String> SECRET_PROPERTY_NAMES;
- private static final Set<String> MULTI_VALUE_PREFIXES;
- static {
- Set<String> props = new HashSet<>(20);
- props.add("allowCompression");
- props.add("autoCommit");
- props.add("collection");
- props.add("connectionTimeout");
- props.add("defaultMaxConnectionsPerHost");
- props.add("followRedirects");
- props.add("httpClient");
- props.add("lazyStartProducer");
- props.add("maxRetries");
- props.add("maxTotalConnections");
- props.add("password");
- props.add("requestHandler");
- props.add("soTimeout");
- props.add("solrClient");
- props.add("streamingQueueSize");
- props.add("streamingThreadCount");
- props.add("url");
- props.add("username");
- props.add("zkChroot");
- props.add("zkHost");
- PROPERTY_NAMES = Collections.unmodifiableSet(props);
- Set<String> secretProps = new HashSet<>(2);
- secretProps.add("password");
- secretProps.add("username");
- SECRET_PROPERTY_NAMES = Collections.unmodifiableSet(secretProps);
- MULTI_VALUE_PREFIXES = Collections.emptySet();
- }
-
- @Override
- public boolean isEnabled(String scheme) {
- for (String s : SCHEMES) {
- if (s.equals(scheme)) {
- return true;
- }
- }
- return false;
- }
-
- @Override
- public String buildUri(String scheme, Map<String, Object> properties, boolean encode) throws URISyntaxException {
- String syntax = scheme + BASE;
- String uri = syntax;
-
- Map<String, Object> copy = new HashMap<>(properties);
-
- uri = buildPathParameter(syntax, uri, "url", null, true, copy);
- uri = buildQueryParameters(uri, copy, encode);
- return uri;
- }
-
- @Override
- public Set<String> propertyNames() {
- return PROPERTY_NAMES;
- }
-
- @Override
- public Set<String> secretPropertyNames() {
- return SECRET_PROPERTY_NAMES;
- }
-
- @Override
- public Set<String> multiValuePrefixes() {
- return MULTI_VALUE_PREFIXES;
- }
-
- @Override
- public boolean isLenientProperties() {
- return false;
- }
-}
-
diff --git a/components/camel-solr/src/generated/resources/META-INF/services/org/apache/camel/component.properties b/components/camel-solr/src/generated/resources/META-INF/services/org/apache/camel/component.properties
deleted file mode 100644
index b50da14398b..00000000000
--- a/components/camel-solr/src/generated/resources/META-INF/services/org/apache/camel/component.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-# Generated by camel build tools - do NOT edit this file!
-components=solr solrCloud solrs
-groupId=org.apache.camel
-artifactId=camel-solr
-version=4.0.0-SNAPSHOT
-projectName=Camel :: Solr
-projectDescription=Camel Solr Support
diff --git a/components/camel-solr/src/generated/resources/META-INF/services/org/apache/camel/component/solr b/components/camel-solr/src/generated/resources/META-INF/services/org/apache/camel/component/solr
deleted file mode 100644
index 96b68397057..00000000000
--- a/components/camel-solr/src/generated/resources/META-INF/services/org/apache/camel/component/solr
+++ /dev/null
@@ -1,2 +0,0 @@
-# Generated by camel build tools - do NOT edit this file!
-class=org.apache.camel.component.solr.SolrComponent
diff --git a/components/camel-solr/src/generated/resources/META-INF/services/org/apache/camel/component/solrCloud b/components/camel-solr/src/generated/resources/META-INF/services/org/apache/camel/component/solrCloud
deleted file mode 100644
index 96b68397057..00000000000
--- a/components/camel-solr/src/generated/resources/META-INF/services/org/apache/camel/component/solrCloud
+++ /dev/null
@@ -1,2 +0,0 @@
-# Generated by camel build tools - do NOT edit this file!
-class=org.apache.camel.component.solr.SolrComponent
diff --git a/components/camel-solr/src/generated/resources/META-INF/services/org/apache/camel/component/solrs b/components/camel-solr/src/generated/resources/META-INF/services/org/apache/camel/component/solrs
deleted file mode 100644
index 96b68397057..00000000000
--- a/components/camel-solr/src/generated/resources/META-INF/services/org/apache/camel/component/solrs
+++ /dev/null
@@ -1,2 +0,0 @@
-# Generated by camel build tools - do NOT edit this file!
-class=org.apache.camel.component.solr.SolrComponent
diff --git a/components/camel-solr/src/generated/resources/META-INF/services/org/apache/camel/configurer/solr-component b/components/camel-solr/src/generated/resources/META-INF/services/org/apache/camel/configurer/solr-component
deleted file mode 100644
index 1a2e6ff094f..00000000000
--- a/components/camel-solr/src/generated/resources/META-INF/services/org/apache/camel/configurer/solr-component
+++ /dev/null
@@ -1,2 +0,0 @@
-# Generated by camel build tools - do NOT edit this file!
-class=org.apache.camel.component.solr.SolrComponentConfigurer
diff --git a/components/camel-solr/src/generated/resources/META-INF/services/org/apache/camel/configurer/solr-endpoint b/components/camel-solr/src/generated/resources/META-INF/services/org/apache/camel/configurer/solr-endpoint
deleted file mode 100644
index 7e2083d27d4..00000000000
--- a/components/camel-solr/src/generated/resources/META-INF/services/org/apache/camel/configurer/solr-endpoint
+++ /dev/null
@@ -1,2 +0,0 @@
-# Generated by camel build tools - do NOT edit this file!
-class=org.apache.camel.component.solr.SolrEndpointConfigurer
diff --git a/components/camel-solr/src/generated/resources/META-INF/services/org/apache/camel/urifactory/solr-endpoint b/components/camel-solr/src/generated/resources/META-INF/services/org/apache/camel/urifactory/solr-endpoint
deleted file mode 100644
index ca05dd4eb92..00000000000
--- a/components/camel-solr/src/generated/resources/META-INF/services/org/apache/camel/urifactory/solr-endpoint
+++ /dev/null
@@ -1,2 +0,0 @@
-# Generated by camel build tools - do NOT edit this file!
-class=org.apache.camel.component.solr.SolrEndpointUriFactory
diff --git a/components/camel-solr/src/generated/resources/META-INF/services/org/apache/camel/urifactory/solrCloud-endpoint b/components/camel-solr/src/generated/resources/META-INF/services/org/apache/camel/urifactory/solrCloud-endpoint
deleted file mode 100644
index ca05dd4eb92..00000000000
--- a/components/camel-solr/src/generated/resources/META-INF/services/org/apache/camel/urifactory/solrCloud-endpoint
+++ /dev/null
@@ -1,2 +0,0 @@
-# Generated by camel build tools - do NOT edit this file!
-class=org.apache.camel.component.solr.SolrEndpointUriFactory
diff --git a/components/camel-solr/src/generated/resources/META-INF/services/org/apache/camel/urifactory/solrs-endpoint b/components/camel-solr/src/generated/resources/META-INF/services/org/apache/camel/urifactory/solrs-endpoint
deleted file mode 100644
index ca05dd4eb92..00000000000
--- a/components/camel-solr/src/generated/resources/META-INF/services/org/apache/camel/urifactory/solrs-endpoint
+++ /dev/null
@@ -1,2 +0,0 @@
-# Generated by camel build tools - do NOT edit this file!
-class=org.apache.camel.component.solr.SolrEndpointUriFactory
diff --git a/components/camel-solr/src/generated/resources/org/apache/camel/component/solr/solr.json b/components/camel-solr/src/generated/resources/org/apache/camel/component/solr/solr.json
deleted file mode 100644
index 0691c024dee..00000000000
--- a/components/camel-solr/src/generated/resources/org/apache/camel/component/solr/solr.json
+++ /dev/null
@@ -1,58 +0,0 @@
-{
- "component": {
- "kind": "component",
- "name": "solr",
- "title": "Solr",
- "description": "Perform operations against Apache Lucene Solr.",
- "deprecated": false,
- "firstVersion": "2.9.0",
- "label": "monitoring,search",
- "javaType": "org.apache.camel.component.solr.SolrComponent",
- "supportLevel": "Stable",
- "groupId": "org.apache.camel",
- "artifactId": "camel-solr",
- "version": "4.0.0-SNAPSHOT",
- "scheme": "solr",
- "extendsScheme": "",
- "alternativeSchemes": "solr,solrs,solrCloud",
- "syntax": "solr:url",
- "async": false,
- "api": false,
- "consumerOnly": false,
- "producerOnly": true,
- "lenientProperties": false
- },
- "componentProperties": {
- "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during star [...]
- "autowiredEnabled": { "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which t [...]
- },
- "headers": {
- "CamelSolrClient": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "org.apache.solr.client.solrj.SolrClient", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The client.", "constantName": "org.apache.camel.component.solr.SolrConstants#CLIENT" },
- "CamelSolrCollection": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The collection to execute the request again.", "constantName": "org.apache.camel.component.solr.SolrConstants#COLLECTION" },
- "SolrOperation": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation to perform.", "constantName": "org.apache.camel.component.solr.SolrConstants#OPERATION" },
- "CamelSolrQueryString": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The query to execute.", "constantName": "org.apache.camel.component.solr.SolrConstants#QUERY_STRING" },
- "Content-Type": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The content type.", "constantName": "org.apache.camel.component.solr.SolrConstants#CONTENT_TYPE" }
- },
- "properties": {
- "url": { "kind": "path", "displayName": "Url", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Hostname and port for the Solr server(s). Multiple hosts can be specified, separated with a comma. See the solrClient parame [...]
- "autoCommit": { "kind": "parameter", "displayName": "Auto Commit", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "If true, each producer operation will be automatically followed by a commit" },
- "connectionTimeout": { "kind": "parameter", "displayName": "Connection Timeout", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Sets the connection timeout on the SolrClient" },
- "defaultMaxConnectionsPerHost": { "kind": "parameter", "displayName": "Default Max Connections Per Host", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": true, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "maxConnectionsPerHost on the underlying HttpConnectionManager" },
- "httpClient": { "kind": "parameter", "displayName": "Http Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.http.client.HttpClient", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Sets the http client to be used by the solrClient. This is only applicable when solrClient is not set." },
- "maxRetries": { "kind": "parameter", "displayName": "Max Retries", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": true, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Maximum number of retries to attempt in the event of transient errors" },
- "maxTotalConnections": { "kind": "parameter", "displayName": "Max Total Connections", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": true, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "maxTotalConnection on the underlying HttpConnectionManager" },
- "requestHandler": { "kind": "parameter", "displayName": "Request Handler", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Set the request handler to be used" },
- "solrClient": { "kind": "parameter", "displayName": "Solr Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.solr.client.solrj.SolrClient", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Uses the provided solr client to connect to solr. When this parameter is not specified, camel applies t [...]
- "soTimeout": { "kind": "parameter", "displayName": "So Timeout", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Sets the socket timeout on the SolrClient" },
- "streamingQueueSize": { "kind": "parameter", "displayName": "Streaming Queue Size", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 10, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Sets the queue size for the ConcurrentUpdateSolrClient" },
- "streamingThreadCount": { "kind": "parameter", "displayName": "Streaming Thread Count", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 2, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Sets the number of threads for the ConcurrentUpdateSolrClient" },
- "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may other [...]
- "collection": { "kind": "parameter", "displayName": "Collection", "group": "CloudSolrClient", "label": "CloudSolrClient", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Set the default collection for SolrCloud" },
- "zkChroot": { "kind": "parameter", "displayName": "Zk Chroot", "group": "CloudSolrClient", "label": "CloudSolrClient", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Set the chroot of the zookeeper connection (include the leading slash; e.g. '\/mychroot')" },
- "zkHost": { "kind": "parameter", "displayName": "Zk Host", "group": "CloudSolrClient", "label": "CloudSolrClient", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Set the ZooKeeper host(s) urls which the CloudSolrClient uses, e.g. zkHost=localhost:2181,localhost:2182. Option [...]
- "allowCompression": { "kind": "parameter", "displayName": "Allow Compression", "group": "HttpSolrClient", "label": "HttpSolrClient", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Server side must support gzip or deflate for this to have any effect" },
- "followRedirects": { "kind": "parameter", "displayName": "Follow Redirects", "group": "HttpSolrClient", "label": "HttpSolrClient", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Indicates whether redirects are used to get to the Solr server" },
- "password": { "kind": "parameter", "displayName": "Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Sets password for basic auth plugin enabled servers" },
- "username": { "kind": "parameter", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Sets username for basic auth plugin enabled servers" }
- }
-}
diff --git a/components/camel-solr/src/generated/resources/org/apache/camel/component/solr/solrCloud.json b/components/camel-solr/src/generated/resources/org/apache/camel/component/solr/solrCloud.json
deleted file mode 100644
index 8a5b3edf6a4..00000000000
--- a/components/camel-solr/src/generated/resources/org/apache/camel/component/solr/solrCloud.json
+++ /dev/null
@@ -1,58 +0,0 @@
-{
- "component": {
- "kind": "component",
- "name": "solrCloud",
- "title": "Solr",
- "description": "Perform operations against Apache Lucene Solr.",
- "deprecated": false,
- "firstVersion": "2.9.0",
- "label": "monitoring,search",
- "javaType": "org.apache.camel.component.solr.SolrComponent",
- "supportLevel": "Stable",
- "groupId": "org.apache.camel",
- "artifactId": "camel-solr",
- "version": "4.0.0-SNAPSHOT",
- "scheme": "solrCloud",
- "extendsScheme": "",
- "alternativeSchemes": "solr,solrs,solrCloud",
- "syntax": "solrCloud:url",
- "async": false,
- "api": false,
- "consumerOnly": false,
- "producerOnly": true,
- "lenientProperties": false
- },
- "componentProperties": {
- "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during star [...]
- "autowiredEnabled": { "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which t [...]
- },
- "headers": {
- "CamelSolrClient": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "org.apache.solr.client.solrj.SolrClient", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The client.", "constantName": "org.apache.camel.component.solr.SolrConstants#CLIENT" },
- "CamelSolrCollection": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The collection to execute the request again.", "constantName": "org.apache.camel.component.solr.SolrConstants#COLLECTION" },
- "SolrOperation": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation to perform.", "constantName": "org.apache.camel.component.solr.SolrConstants#OPERATION" },
- "CamelSolrQueryString": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The query to execute.", "constantName": "org.apache.camel.component.solr.SolrConstants#QUERY_STRING" },
- "Content-Type": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The content type.", "constantName": "org.apache.camel.component.solr.SolrConstants#CONTENT_TYPE" }
- },
- "properties": {
- "url": { "kind": "path", "displayName": "Url", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Hostname and port for the Solr server(s). Multiple hosts can be specified, separated with a comma. See the solrClient parame [...]
- "autoCommit": { "kind": "parameter", "displayName": "Auto Commit", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "If true, each producer operation will be automatically followed by a commit" },
- "connectionTimeout": { "kind": "parameter", "displayName": "Connection Timeout", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Sets the connection timeout on the SolrClient" },
- "defaultMaxConnectionsPerHost": { "kind": "parameter", "displayName": "Default Max Connections Per Host", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": true, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "maxConnectionsPerHost on the underlying HttpConnectionManager" },
- "httpClient": { "kind": "parameter", "displayName": "Http Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.http.client.HttpClient", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Sets the http client to be used by the solrClient. This is only applicable when solrClient is not set." },
- "maxRetries": { "kind": "parameter", "displayName": "Max Retries", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": true, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Maximum number of retries to attempt in the event of transient errors" },
- "maxTotalConnections": { "kind": "parameter", "displayName": "Max Total Connections", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": true, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "maxTotalConnection on the underlying HttpConnectionManager" },
- "requestHandler": { "kind": "parameter", "displayName": "Request Handler", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Set the request handler to be used" },
- "solrClient": { "kind": "parameter", "displayName": "Solr Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.solr.client.solrj.SolrClient", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Uses the provided solr client to connect to solr. When this parameter is not specified, camel applies t [...]
- "soTimeout": { "kind": "parameter", "displayName": "So Timeout", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Sets the socket timeout on the SolrClient" },
- "streamingQueueSize": { "kind": "parameter", "displayName": "Streaming Queue Size", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 10, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Sets the queue size for the ConcurrentUpdateSolrClient" },
- "streamingThreadCount": { "kind": "parameter", "displayName": "Streaming Thread Count", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 2, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Sets the number of threads for the ConcurrentUpdateSolrClient" },
- "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may other [...]
- "collection": { "kind": "parameter", "displayName": "Collection", "group": "CloudSolrClient", "label": "CloudSolrClient", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Set the default collection for SolrCloud" },
- "zkChroot": { "kind": "parameter", "displayName": "Zk Chroot", "group": "CloudSolrClient", "label": "CloudSolrClient", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Set the chroot of the zookeeper connection (include the leading slash; e.g. '\/mychroot')" },
- "zkHost": { "kind": "parameter", "displayName": "Zk Host", "group": "CloudSolrClient", "label": "CloudSolrClient", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Set the ZooKeeper host(s) urls which the CloudSolrClient uses, e.g. zkHost=localhost:2181,localhost:2182. Option [...]
- "allowCompression": { "kind": "parameter", "displayName": "Allow Compression", "group": "HttpSolrClient", "label": "HttpSolrClient", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Server side must support gzip or deflate for this to have any effect" },
- "followRedirects": { "kind": "parameter", "displayName": "Follow Redirects", "group": "HttpSolrClient", "label": "HttpSolrClient", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Indicates whether redirects are used to get to the Solr server" },
- "password": { "kind": "parameter", "displayName": "Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Sets password for basic auth plugin enabled servers" },
- "username": { "kind": "parameter", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Sets username for basic auth plugin enabled servers" }
- }
-}
diff --git a/components/camel-solr/src/generated/resources/org/apache/camel/component/solr/solrs.json b/components/camel-solr/src/generated/resources/org/apache/camel/component/solr/solrs.json
deleted file mode 100644
index 805226a5be1..00000000000
--- a/components/camel-solr/src/generated/resources/org/apache/camel/component/solr/solrs.json
+++ /dev/null
@@ -1,58 +0,0 @@
-{
- "component": {
- "kind": "component",
- "name": "solrs",
- "title": "Solr (Secure)",
- "description": "Perform operations against Apache Lucene Solr.",
- "deprecated": false,
- "firstVersion": "2.9.0",
- "label": "monitoring,search",
- "javaType": "org.apache.camel.component.solr.SolrComponent",
- "supportLevel": "Stable",
- "groupId": "org.apache.camel",
- "artifactId": "camel-solr",
- "version": "4.0.0-SNAPSHOT",
- "scheme": "solrs",
- "extendsScheme": "",
- "alternativeSchemes": "solr,solrs,solrCloud",
- "syntax": "solrs:url",
- "async": false,
- "api": false,
- "consumerOnly": false,
- "producerOnly": true,
- "lenientProperties": false
- },
- "componentProperties": {
- "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during star [...]
- "autowiredEnabled": { "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which t [...]
- },
- "headers": {
- "CamelSolrClient": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "org.apache.solr.client.solrj.SolrClient", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The client.", "constantName": "org.apache.camel.component.solr.SolrConstants#CLIENT" },
- "CamelSolrCollection": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The collection to execute the request again.", "constantName": "org.apache.camel.component.solr.SolrConstants#COLLECTION" },
- "SolrOperation": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation to perform.", "constantName": "org.apache.camel.component.solr.SolrConstants#OPERATION" },
- "CamelSolrQueryString": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The query to execute.", "constantName": "org.apache.camel.component.solr.SolrConstants#QUERY_STRING" },
- "Content-Type": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The content type.", "constantName": "org.apache.camel.component.solr.SolrConstants#CONTENT_TYPE" }
- },
- "properties": {
- "url": { "kind": "path", "displayName": "Url", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Hostname and port for the Solr server(s). Multiple hosts can be specified, separated with a comma. See the solrClient parame [...]
- "autoCommit": { "kind": "parameter", "displayName": "Auto Commit", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "If true, each producer operation will be automatically followed by a commit" },
- "connectionTimeout": { "kind": "parameter", "displayName": "Connection Timeout", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Sets the connection timeout on the SolrClient" },
- "defaultMaxConnectionsPerHost": { "kind": "parameter", "displayName": "Default Max Connections Per Host", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": true, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "maxConnectionsPerHost on the underlying HttpConnectionManager" },
- "httpClient": { "kind": "parameter", "displayName": "Http Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.http.client.HttpClient", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Sets the http client to be used by the solrClient. This is only applicable when solrClient is not set." },
- "maxRetries": { "kind": "parameter", "displayName": "Max Retries", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": true, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Maximum number of retries to attempt in the event of transient errors" },
- "maxTotalConnections": { "kind": "parameter", "displayName": "Max Total Connections", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": true, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "maxTotalConnection on the underlying HttpConnectionManager" },
- "requestHandler": { "kind": "parameter", "displayName": "Request Handler", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Set the request handler to be used" },
- "solrClient": { "kind": "parameter", "displayName": "Solr Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.solr.client.solrj.SolrClient", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Uses the provided solr client to connect to solr. When this parameter is not specified, camel applies t [...]
- "soTimeout": { "kind": "parameter", "displayName": "So Timeout", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Sets the socket timeout on the SolrClient" },
- "streamingQueueSize": { "kind": "parameter", "displayName": "Streaming Queue Size", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 10, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Sets the queue size for the ConcurrentUpdateSolrClient" },
- "streamingThreadCount": { "kind": "parameter", "displayName": "Streaming Thread Count", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 2, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Sets the number of threads for the ConcurrentUpdateSolrClient" },
- "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may other [...]
- "collection": { "kind": "parameter", "displayName": "Collection", "group": "CloudSolrClient", "label": "CloudSolrClient", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Set the default collection for SolrCloud" },
- "zkChroot": { "kind": "parameter", "displayName": "Zk Chroot", "group": "CloudSolrClient", "label": "CloudSolrClient", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Set the chroot of the zookeeper connection (include the leading slash; e.g. '\/mychroot')" },
- "zkHost": { "kind": "parameter", "displayName": "Zk Host", "group": "CloudSolrClient", "label": "CloudSolrClient", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Set the ZooKeeper host(s) urls which the CloudSolrClient uses, e.g. zkHost=localhost:2181,localhost:2182. Option [...]
- "allowCompression": { "kind": "parameter", "displayName": "Allow Compression", "group": "HttpSolrClient", "label": "HttpSolrClient", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Server side must support gzip or deflate for this to have any effect" },
- "followRedirects": { "kind": "parameter", "displayName": "Follow Redirects", "group": "HttpSolrClient", "label": "HttpSolrClient", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Indicates whether redirects are used to get to the Solr server" },
- "password": { "kind": "parameter", "displayName": "Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Sets password for basic auth plugin enabled servers" },
- "username": { "kind": "parameter", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.solr.SolrConfiguration", "configurationField": "solrConfiguration", "description": "Sets username for basic auth plugin enabled servers" }
- }
-}
diff --git a/components/camel-solr/src/main/docs/solr-component.adoc b/components/camel-solr/src/main/docs/solr-component.adoc
deleted file mode 100644
index 62c4f7ce0e6..00000000000
--- a/components/camel-solr/src/main/docs/solr-component.adoc
+++ /dev/null
@@ -1,169 +0,0 @@
-= Solr Component
-:doctitle: Solr
-:shortname: solr
-:artifactid: camel-solr
-:description: Perform operations against Apache Lucene Solr.
-:since: 2.9
-:supportlevel: Stable
-:component-header: Only producer is supported
-//Manually maintained attributes
-:camel-spring-boot-name: solr
-
-*Since Camel {since}*
-
-*{component-header}*
-
-The Solr component allows you to interface with an
-https://solr.apache.org/[Apache Solr] server.
-
-Maven users will need to add the following dependency to their `pom.xml`
-for this component:
-
-[source,xml]
-------------------------------------------------------------
-<dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-solr</artifactId>
- <version>x.x.x</version>
- <!-- use the same version as your Camel core version -->
-</dependency>
-------------------------------------------------------------
-
-== URI format
-
---------------------------------------
-solr://host[:port]/solr?[options]
-solrs://host[:port]/solr?[options]
-solrCloud://host[:port]/solr?[options]
---------------------------------------
-
-// component-configure options: START
-
-// component-configure options: END
-
-// component options: START
-include::partial$component-configure-options.adoc[]
-include::partial$component-endpoint-options.adoc[]
-// component options: END
-
-// endpoint options: START
-
-// endpoint options: END
-// component headers: START
-include::partial$component-endpoint-headers.adoc[]
-// component headers: END
-
-== Message Operations
-
-The following Solr operations are currently supported. Simply set an
-exchange header with a key of "SolrOperation" and a value set to one of
-the following. Some operations also require the message body to be set.
-
-* INSERT
-* INSERT_STREAMING
-
-[width="100%",cols="10%,10%,80%",options="header",]
-|=======================================================================
-|Operation |Message body |Description
-
-|INSERT/INSERT_STREAMING |n/a |adds an index using message headers (must be prefixed with "SolrField.")
-
-|INSERT/INSERT_STREAMING |File |adds an index using the given File (using ContentStreamUpdateRequest)
-
-|INSERT/INSERT_STREAMING |SolrInputDocument |updates index based on the given SolrInputDocument
-
-|INSERT/INSERT_STREAMING |String XML |updates index based on the given XML (must follow
-SolrInputDocument format)
-
-|ADD_BEAN |bean instance |adds an index based on values in an
-http://wiki.apache.org/solr/Solrj#Directly_adding_POJOs_to_Solr[annotated
-bean]
-
-|ADD_BEANS |collection<bean> |adds index based on a collection of
-http://wiki.apache.org/solr/Solrj#Directly_adding_POJOs_to_Solr[annotated
-bean]
-
-|DELETE_BY_ID |index id to delete |delete a record by ID
-
-|DELETE_BY_QUERY |query string |delete a record by a query
-
-|COMMIT |n/a |performs a commit on any pending index changes
-
-|SOFT_COMMIT |n/a |performs a `soft commit` (without guarantee that Lucene index files are written to stable storage; useful for Near Real Time operations) on any pending index changes
-
-|ROLLBACK |n/a |performs a rollback on any pending index changes
-
-|OPTIMIZE |n/a |performs a commit on any pending index changes and then runs the
-optimize command (This command reorganizes the Solr index and might be a heavy task)
-|=======================================================================
-
-== Example
-
-Below is a simple INSERT, DELETE and COMMIT example
-
-[source,java]
----------------------------------------------------------------------------------------
-from("direct:insert")
- .setHeader(SolrConstants.OPERATION, constant(SolrConstants.OPERATION_INSERT))
- .setHeader(SolrConstants.FIELD + "id", body())
- .to("solr://localhost:8983/solr");
-
-from("direct:delete")
- .setHeader(SolrConstants.OPERATION, constant(SolrConstants.OPERATION_DELETE_BY_ID))
- .to("solr://localhost:8983/solr");
-
-from("direct:commit")
- .setHeader(SolrConstants.OPERATION, constant(SolrConstants.OPERATION_COMMIT))
- .to("solr://localhost:8983/solr");
----------------------------------------------------------------------------------------
-
-[source,xml]
-------------------------------------------
-<route>
- <from uri="direct:insert"/>
- <setHeader name="SolrOperation">
- <constant>INSERT</constant>
- </setHeader>
- <setHeader name="SolrField.id">
- <simple>${body}</simple>
- </setHeader>
- <to uri="solr://localhost:8983/solr"/>
-</route>
-<route>
- <from uri="direct:delete"/>
- <setHeader name="SolrOperation">
- <constant>DELETE_BY_ID</constant>
- </setHeader>
- <to uri="solr://localhost:8983/solr"/>
-</route>
-<route>
- <from uri="direct:commit"/>
- <setHeader name="SolrOperation">
- <constant>COMMIT</constant>
- </setHeader>
- <to uri="solr://localhost:8983/solr"/>
-</route>
-------------------------------------------
-
-A client would simply need to pass a body message to the insert or
-delete routes and then call the commit route.
-
-[source,java]
------------------------------------------------
-template.sendBody("direct:insert", "1234");
-template.sendBody("direct:commit", null);
-template.sendBody("direct:delete", "1234");
-template.sendBody("direct:commit", null);
------------------------------------------------
-
-== Querying Solr
-
-The components provide a producer operation to query Solr.
-
-For more information:
-
-https://solr.apache.org/guide/8_8/the-standard-query-parser.html[Solr Query Syntax]
-
-
-
-include::spring-boot:partial$starter.adoc[]
diff --git a/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrClientHandler.java b/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrClientHandler.java
deleted file mode 100644
index ffcdaa8e36a..00000000000
--- a/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrClientHandler.java
+++ /dev/null
@@ -1,154 +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.camel.component.solr;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Optional;
-import java.util.stream.Collectors;
-
-import org.apache.camel.util.StringHelper;
-import org.apache.solr.client.solrj.SolrClient;
-
-public abstract class SolrClientHandler {
-
- public final SolrConfiguration solrConfiguration;
-
- public SolrClientHandler(SolrConfiguration solrConfiguration) {
- this.solrConfiguration = solrConfiguration;
- }
-
- protected abstract SolrClient getSolrClient();
-
- protected static Optional<String> getZkChrootFromUrl(String path) {
- path = StringHelper.removeStartingCharacters(path, '/');
- if (!path.contains("/")) {
- return Optional.empty();
- }
- // find first entry of csv that has /
- String pathWithZkChroot = Arrays.stream(path.split(",")).filter(s -> s.contains("/")).findFirst().orElse("");
- // don't consider as zkChroot when 1st subPath = 'solr'
- return Arrays.asList(pathWithZkChroot.split("/")).get(1).equals("solr")
- ? Optional.empty() : Optional.of(pathWithZkChroot.substring(pathWithZkChroot.indexOf('/')));
- }
-
- protected static String parseHostsFromUrl(String path, Optional<String> zkChroot) {
- String hostsPath = StringHelper.removeStartingCharacters(path, '/');
- return (zkChroot.isPresent()) ? hostsPath.substring(0, hostsPath.indexOf('/')) : hostsPath;
- }
-
- protected String getFirstUrlFromList() {
- return getUrlListFrom(solrConfiguration).get(0);
- }
-
- protected static List<String> getUrlListFrom(SolrConfiguration solrConfiguration) {
- String url = solrConfiguration.getZkHost() != null && !solrConfiguration.getZkHost().isEmpty()
- ? solrConfiguration.getZkHost() : solrConfiguration.getUrl();
- // add scheme when required
- List<String> urlList = Arrays
- .asList(url.split(","))
- .stream()
- .map(s -> solrConfiguration.getSolrScheme().getScheme().concat(s))
- .collect(Collectors.toList());
- // validate url syntax via parsing in URL instance
- for (String s : urlList) {
- try {
- // solrCloud requires addition of HTTP scheme to be able to consider it as a valid URL scheme
- new URL(
- SolrConfiguration.SolrScheme.SOLRCLOUD.equals(solrConfiguration.getSolrScheme())
- ? SolrConfiguration.SolrScheme.SOLR.getScheme().concat(s) : s);
- } catch (MalformedURLException e) {
- throw new IllegalArgumentException(
- String.format(
- "Url '%s' not valid for endpoint with uri=%s",
- s,
- solrConfiguration.getSolrScheme().getUri()));
- }
- }
- return urlList;
- }
-
- /**
- * Signature defines parameters deciding whether or not to share the solrClient - sharing allowed: same signature -
- * sharing not allowed: different signature
- */
- public static String getSignature(SolrConfiguration solrConfiguration) {
- if (solrConfiguration.getSolrClient() != null) {
- return solrConfiguration.getSolrClient().toString();
- }
- StringBuilder sb = new StringBuilder();
- if (solrConfiguration.getSolrEndpoint() != null) {
- sb.append(solrConfiguration.getSolrEndpoint());
- }
- if (solrConfiguration.getUseConcurrentUpdateSolrClient()) {
- sb.append("_");
- sb.append(solrConfiguration.getUseConcurrentUpdateSolrClient());
- }
- return sb.toString();
- }
-
- /**
- * Allows to override solrClient configuration based on processing solrOperation
- */
- public static SolrConfiguration initializeFor(
- String solrOperation, SolrConfiguration solrConfiguration) {
- if (solrOperation == null) {
- return solrConfiguration;
- }
- switch (solrOperation) {
- case SolrConstants.OPERATION_INSERT_STREAMING:
- if (!SolrConfiguration.SolrScheme.SOLRCLOUD.equals(solrConfiguration.getSolrScheme())) {
- SolrConfiguration newSolrConfiguration = solrConfiguration.deepCopy();
- newSolrConfiguration.setUseConcurrentUpdateSolrClient(true);
- return newSolrConfiguration;
- }
- return solrConfiguration;
- default:
- return solrConfiguration;
- }
- }
-
- protected static SolrClient getSolrClient(SolrConfiguration solrConfiguration) {
- // explicilty defined solrClient
- if (solrConfiguration.getSolrClient() != null) {
- return solrConfiguration.getSolrClient();
- }
- SolrClientHandler solrClientHandler = null;
- List<String> urlList = getUrlListFrom(solrConfiguration);
- // solrCloud scheme is set
- if (SolrConfiguration.SolrScheme.SOLRCLOUD.equals(solrConfiguration.getSolrScheme())) {
- solrClientHandler = new SolrClientHandlerCloud(solrConfiguration);
- } else {
- // more than 1 server provided:
- if (urlList.size() > 1) {
- solrClientHandler = new SolrClientHandlerLbHttp(solrConfiguration);
- } else {
- // config with ConcurrentUpdateSolrClient
- if (solrConfiguration.getUseConcurrentUpdateSolrClient()) {
- solrClientHandler = new SolrClientHandlerConcurrentUpdate(solrConfiguration);
- } else {
- // base HttpSolrClient
- solrClientHandler = new SolrClientHandlerHttp(solrConfiguration);
- }
- }
- }
- return solrClientHandler.getSolrClient();
- }
-
-}
diff --git a/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrClientHandlerCloud.java b/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrClientHandlerCloud.java
deleted file mode 100644
index 05128c5915a..00000000000
--- a/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrClientHandlerCloud.java
+++ /dev/null
@@ -1,53 +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.camel.component.solr;
-
-import java.util.List;
-import java.util.Optional;
-
-import org.apache.solr.client.solrj.SolrClient;
-import org.apache.solr.client.solrj.impl.CloudSolrClient;
-
-public class SolrClientHandlerCloud extends SolrClientHandler {
-
- public SolrClientHandlerCloud(SolrConfiguration solrConfiguration) {
- super(solrConfiguration);
- }
-
- protected SolrClient getSolrClient() {
- Optional<String> zkChrootOptional = Optional.ofNullable(solrConfiguration.getZkChroot());
- List<String> urlList = getUrlListFrom(solrConfiguration);
- CloudSolrClient.Builder builder = new CloudSolrClient.Builder(
- urlList,
- zkChrootOptional);
- if (solrConfiguration.getConnectionTimeout() != null) {
- builder.withConnectionTimeout(solrConfiguration.getConnectionTimeout());
- }
- if (solrConfiguration.getSoTimeout() != null) {
- builder.withSocketTimeout(solrConfiguration.getSoTimeout());
- }
- if (solrConfiguration.getHttpClient() != null) {
- builder.withHttpClient(solrConfiguration.getHttpClient());
- }
- CloudSolrClient cloudSolrClient = builder.build();
- if (solrConfiguration.getCollection() != null && !solrConfiguration.getCollection().isEmpty()) {
- cloudSolrClient.setDefaultCollection(solrConfiguration.getCollection());
- }
- return cloudSolrClient;
- }
-
-}
diff --git a/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrClientHandlerConcurrentUpdate.java b/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrClientHandlerConcurrentUpdate.java
deleted file mode 100644
index f60a07c61b2..00000000000
--- a/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrClientHandlerConcurrentUpdate.java
+++ /dev/null
@@ -1,45 +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.camel.component.solr;
-
-import org.apache.solr.client.solrj.SolrClient;
-import org.apache.solr.client.solrj.impl.ConcurrentUpdateSolrClient;
-
-public class SolrClientHandlerConcurrentUpdate extends SolrClientHandler {
-
- public SolrClientHandlerConcurrentUpdate(SolrConfiguration solrConfiguration) {
- super(solrConfiguration);
- }
-
- protected SolrClient getSolrClient() {
- ConcurrentUpdateSolrClient.Builder builder = new ConcurrentUpdateSolrClient.Builder(
- getFirstUrlFromList());
- if (solrConfiguration.getConnectionTimeout() != null) {
- builder.withConnectionTimeout(solrConfiguration.getConnectionTimeout());
- }
- if (solrConfiguration.getSoTimeout() != null) {
- builder.withSocketTimeout(solrConfiguration.getSoTimeout());
- }
- if (solrConfiguration.getHttpClient() != null) {
- builder.withHttpClient(solrConfiguration.getHttpClient());
- }
- builder.withQueueSize(solrConfiguration.getStreamingQueueSize());
- builder.withThreadCount(solrConfiguration.getStreamingThreadCount());
- return builder.build();
- }
-
-}
diff --git a/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrClientHandlerHttp.java b/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrClientHandlerHttp.java
deleted file mode 100644
index caf0cd7e319..00000000000
--- a/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrClientHandlerHttp.java
+++ /dev/null
@@ -1,49 +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.camel.component.solr;
-
-import org.apache.solr.client.solrj.SolrClient;
-import org.apache.solr.client.solrj.impl.HttpSolrClient;
-
-public class SolrClientHandlerHttp extends SolrClientHandler {
-
- public SolrClientHandlerHttp(SolrConfiguration solrConfiguration) {
- super(solrConfiguration);
- }
-
- protected SolrClient getSolrClient() {
- HttpSolrClient.Builder builder = new HttpSolrClient.Builder(getFirstUrlFromList());
- if (solrConfiguration.getConnectionTimeout() != null) {
- builder.withConnectionTimeout(solrConfiguration.getConnectionTimeout());
- }
- if (solrConfiguration.getSoTimeout() != null) {
- builder.withSocketTimeout(solrConfiguration.getSoTimeout());
- }
- if (solrConfiguration.getHttpClient() != null) {
- builder.withHttpClient(solrConfiguration.getHttpClient());
- }
- if (solrConfiguration.getAllowCompression() != null) {
- builder.allowCompression(solrConfiguration.getAllowCompression());
- }
- HttpSolrClient httpSolrClient = builder.build();
- if (solrConfiguration.getFollowRedirects() != null) {
- httpSolrClient.setFollowRedirects(solrConfiguration.getFollowRedirects());
- }
- return httpSolrClient;
- }
-
-}
diff --git a/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrClientHandlerLbHttp.java b/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrClientHandlerLbHttp.java
deleted file mode 100644
index 229516af5e3..00000000000
--- a/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrClientHandlerLbHttp.java
+++ /dev/null
@@ -1,45 +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.camel.component.solr;
-
-import org.apache.solr.client.solrj.SolrClient;
-import org.apache.solr.client.solrj.impl.LBHttpSolrClient;
-
-public class SolrClientHandlerLbHttp extends SolrClientHandler {
-
- public SolrClientHandlerLbHttp(SolrConfiguration solrConfiguration) {
- super(solrConfiguration);
- }
-
- protected SolrClient getSolrClient() {
- LBHttpSolrClient.Builder builder = new LBHttpSolrClient.Builder();
- for (String serverUrl : getUrlListFrom(solrConfiguration)) {
- builder.withBaseSolrUrl(serverUrl);
- }
- if (solrConfiguration.getConnectionTimeout() != null) {
- builder.withConnectionTimeout(solrConfiguration.getConnectionTimeout());
- }
- if (solrConfiguration.getSoTimeout() != null) {
- builder.withSocketTimeout(solrConfiguration.getSoTimeout());
- }
- if (solrConfiguration.getHttpClient() != null) {
- builder.withHttpClient(solrConfiguration.getHttpClient());
- }
- return builder.build();
- }
-
-}
diff --git a/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrComponent.java b/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrComponent.java
deleted file mode 100644
index f0790cc9858..00000000000
--- a/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrComponent.java
+++ /dev/null
@@ -1,121 +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.camel.component.solr;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.camel.Endpoint;
-import org.apache.camel.spi.annotations.Component;
-import org.apache.camel.support.DefaultComponent;
-import org.apache.solr.client.solrj.SolrClient;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Represents the component that manages {@link SolrEndpoint}.
- */
-@Component("solr,solrCloud,solrs")
-public class SolrComponent extends DefaultComponent {
-
- private static final Logger LOG = LoggerFactory.getLogger(SolrComponent.class);
-
- private final Map<String, SolrClientReference> solrClientMap = new HashMap<>();
-
- protected static final class SolrClientReference {
- private final SolrClient solrClient;
- private final List<SolrProducer> solrProducerList = new ArrayList<>();
-
- public SolrClientReference(SolrClient solrClient) {
- this.solrClient = solrClient;
- }
-
- public SolrClient getSolrClient() {
- return solrClient;
- }
-
- public int unRegisterSolrProducer(SolrProducer solrProducer) {
- solrProducerList.remove(solrProducer);
- return solrProducerList.size();
- }
-
- public int registerSolrProducer(SolrProducer solrProducer) {
- solrProducerList.add(solrProducer);
- return solrProducerList.size();
- }
-
- }
-
- public SolrComponent() {
- }
-
- @Override
- protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
- SolrConfiguration configuration = SolrConfiguration.newInstance(uri, remaining);
- Endpoint endpoint = new SolrEndpoint(uri, this, configuration);
- setProperties(endpoint, parameters);
- return endpoint;
- }
-
- public SolrClient getSolrClient(SolrProducer solrProducer, SolrConfiguration solrConfiguration) {
- String signature = SolrClientHandler.getSignature(solrConfiguration);
- SolrClientReference solrClientReference;
- if (!solrClientMap.containsKey(signature)) {
- solrClientReference = new SolrClientReference(SolrClientHandler.getSolrClient(solrConfiguration));
- solrClientMap.put(signature, solrClientReference);
- } else {
- solrClientReference = solrClientMap.get(signature);
- }
- // register producer against solrClient (for later close of client)
- solrClientReference.registerSolrProducer(solrProducer);
- return solrClientReference.getSolrClient();
- }
-
- public void closeSolrClient(SolrProducer solrProducer) {
- // close when generated for endpoint
- List<String> signatureToRemoveList = new ArrayList<>();
- for (Map.Entry<String, SolrClientReference> entry : solrClientMap.entrySet()) {
- SolrClientReference solrClientReference = entry.getValue();
- if (solrClientReference.unRegisterSolrProducer(solrProducer) == 0) {
- signatureToRemoveList.add(entry.getKey());
- }
- }
- removeFromSolrClientMap(signatureToRemoveList);
- }
-
- private void removeFromSolrClientMap(Collection<String> signatureToRemoveList) {
- for (String signature : signatureToRemoveList) {
- SolrClientReference solrClientReference = solrClientMap.get(signature);
- solrClientMap.remove(signature);
- try {
- solrClientReference.getSolrClient().close();
- } catch (IOException e) {
- LOG.warn("Error shutting down solr client. This exception is ignored.", e);
- }
- }
- }
-
- @Override
- protected void doShutdown() throws Exception {
- removeFromSolrClientMap(solrClientMap.keySet());
- }
-
-}
diff --git a/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrConfiguration.java b/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrConfiguration.java
deleted file mode 100644
index b64297854e8..00000000000
--- a/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrConfiguration.java
+++ /dev/null
@@ -1,389 +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.camel.component.solr;
-
-import java.util.Optional;
-
-import org.apache.camel.spi.Metadata;
-import org.apache.camel.spi.UriParam;
-import org.apache.camel.spi.UriParams;
-import org.apache.camel.spi.UriPath;
-import org.apache.http.client.HttpClient;
-import org.apache.solr.client.solrj.SolrClient;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@UriParams
-public class SolrConfiguration implements Cloneable {
-
- private static final Logger LOG = LoggerFactory.getLogger(SolrConfiguration.class);
-
- private boolean useConcurrentUpdateSolrClient;
- private SolrEndpoint solrEndpoint;
- private SolrScheme solrScheme;
-
- @UriPath(description = "Hostname and port for the Solr server(s). " +
- "Multiple hosts can be specified, separated with a comma. " +
- "See the solrClient parameter for more information on the SolrClient used to connect to Solr.")
- @Metadata(required = true)
- private final String url;
- @UriParam(defaultValue = "" + SolrConstants.DEFUALT_STREAMING_QUEUE_SIZE)
- private int streamingQueueSize = SolrConstants.DEFUALT_STREAMING_QUEUE_SIZE;
- @UriParam(defaultValue = "" + SolrConstants.DEFAULT_STREAMING_THREAD_COUNT)
- private int streamingThreadCount = SolrConstants.DEFAULT_STREAMING_THREAD_COUNT;
- @UriParam
- private Integer soTimeout;
- @UriParam
- private Integer connectionTimeout;
- @UriParam(label = "HttpSolrClient")
- private Boolean followRedirects;
- @UriParam(label = "HttpSolrClient")
- private Boolean allowCompression;
- @UriParam(label = "CloudSolrClient")
- private String zkHost;
- @UriParam(label = "CloudSolrClient")
- private String zkChroot;
- @UriParam(label = "CloudSolrClient")
- private String collection;
- @UriParam
- private SolrClient solrClient;
- @UriParam
- private HttpClient httpClient;
- @UriParam
- private String requestHandler;
- @UriParam(label = "security", secret = true)
- private String username;
- @UriParam(label = "security", secret = true)
- private String password;
- @UriParam(defaultValue = "false")
- private boolean autoCommit;
- @Deprecated
- @UriParam
- private Integer maxRetries;
- @Deprecated
- @UriParam
- private Integer defaultMaxConnectionsPerHost;
- @Deprecated
- @UriParam
- private Integer maxTotalConnections;
-
- public SolrConfiguration(SolrScheme solrScheme, String url, String zkChroot) {
- this.solrScheme = solrScheme;
- this.url = url;
- this.zkChroot = zkChroot;
- }
-
- public static SolrConfiguration newInstance(String endpointUri, String remaining) {
- SolrScheme solrScheme = SolrScheme.SOLR.getFrom(endpointUri);
- Optional<String> zkChrootOptional = SolrClientHandler.getZkChrootFromUrl(remaining);
- String url = SolrClientHandler.parseHostsFromUrl(remaining, zkChrootOptional);
- SolrConfiguration solrConfiguration = new SolrConfiguration(solrScheme, url, zkChrootOptional.orElse(null));
- // validate url
- SolrClientHandler.getUrlListFrom(solrConfiguration);
- // return configuration
- return solrConfiguration;
- }
-
- public SolrScheme getSolrScheme() {
- return solrScheme;
- }
-
- public void setSolrScheme(SolrScheme solrScheme) {
- this.solrScheme = solrScheme;
- }
-
- public String getUrl() {
- return url;
- }
-
- public int getStreamingQueueSize() {
- return streamingQueueSize;
- }
-
- /**
- * Sets the queue size for the ConcurrentUpdateSolrClient
- */
- public void setStreamingQueueSize(int streamingQueueSize) {
- this.streamingQueueSize = streamingQueueSize;
- }
-
- public int getStreamingThreadCount() {
- return streamingThreadCount;
- }
-
- /**
- * Sets the number of threads for the ConcurrentUpdateSolrClient
- */
- public void setStreamingThreadCount(int streamingThreadCount) {
- this.streamingThreadCount = streamingThreadCount;
- }
-
- public Integer getMaxRetries() {
- return maxRetries;
- }
-
- /**
- * Maximum number of retries to attempt in the event of transient errors
- */
- public void setMaxRetries(Integer maxRetries) {
- this.maxRetries = maxRetries;
- }
-
- public Integer getSoTimeout() {
- return soTimeout;
- }
-
- /**
- * Sets the socket timeout on the SolrClient
- */
- public void setSoTimeout(Integer soTimeout) {
- this.soTimeout = soTimeout;
- }
-
- public Integer getConnectionTimeout() {
- return connectionTimeout;
- }
-
- /**
- * Sets the connection timeout on the SolrClient
- */
- public void setConnectionTimeout(Integer connectionTimeout) {
- this.connectionTimeout = connectionTimeout;
- }
-
- public Integer getDefaultMaxConnectionsPerHost() {
- return defaultMaxConnectionsPerHost;
- }
-
- /**
- * maxConnectionsPerHost on the underlying HttpConnectionManager
- */
- public void setDefaultMaxConnectionsPerHost(Integer defaultMaxConnectionsPerHost) {
- this.defaultMaxConnectionsPerHost = defaultMaxConnectionsPerHost;
- }
-
- public Integer getMaxTotalConnections() {
- return maxTotalConnections;
- }
-
- /**
- * maxTotalConnection on the underlying HttpConnectionManager
- */
- public void setMaxTotalConnections(Integer maxTotalConnections) {
- this.maxTotalConnections = maxTotalConnections;
- }
-
- public Boolean getFollowRedirects() {
- return followRedirects;
- }
-
- /**
- * Indicates whether redirects are used to get to the Solr server
- */
- public void setFollowRedirects(Boolean followRedirects) {
- this.followRedirects = followRedirects;
- }
-
- public Boolean getAllowCompression() {
- return allowCompression;
- }
-
- /**
- * Server side must support gzip or deflate for this to have any effect
- */
- public void setAllowCompression(Boolean allowCompression) {
- this.allowCompression = allowCompression;
- }
-
- public String getZkHost() {
- return zkHost;
- }
-
- /**
- * Set the ZooKeeper host(s) urls which the CloudSolrClient uses, e.g. "zkHost=localhost:2181,localhost:2182".
- * Optionally add the chroot, e.g. "zkHost=localhost:2181,localhost:2182/rootformysolr". In case the first part of
- * the url path (='contextroot') is set to 'solr' (e.g. 'localhost:2181/solr' or 'localhost:2181/solr/..'), then
- * that path is not considered as zookeeper chroot for backward compatibility reasons (this behaviour can be
- * overridden via zkChroot parameter).
- */
- public void setZkHost(String zkHost) {
- Optional<String> zkChrootFromZkHost = SolrClientHandler.getZkChrootFromUrl(zkHost);
- if (zkChrootFromZkHost.isPresent() && getZkChroot() == null) {
- setZkChroot(zkChrootFromZkHost.get());
- }
- this.zkHost = SolrClientHandler.parseHostsFromUrl(zkHost, zkChrootFromZkHost);
- setSolrScheme(SolrScheme.SOLRCLOUD);
- }
-
- public String getZkChroot() {
- return zkChroot;
- }
-
- /**
- * Set the chroot of the zookeeper connection (include the leading slash; e.g. '/mychroot')
- */
- public void setZkChroot(String zkChroot) {
- this.zkChroot = zkChroot;
- setSolrScheme(SolrScheme.SOLRCLOUD);
- }
-
- public String getCollection() {
- return collection;
- }
-
- /**
- * Set the default collection for SolrCloud
- */
- public void setCollection(String collection) {
- this.collection = collection;
- }
-
- public String getRequestHandler() {
- return requestHandler;
- }
-
- /**
- * Set the request handler to be used
- */
- public void setRequestHandler(String requestHandler) {
- this.requestHandler = requestHandler;
- }
-
- public String getUsername() {
- return username;
- }
-
- /**
- * Sets username for basic auth plugin enabled servers
- */
- public void setUsername(String username) {
- this.username = username;
- }
-
- public String getPassword() {
- return password;
- }
-
- /**
- * Sets password for basic auth plugin enabled servers
- */
- public void setPassword(String password) {
- this.password = password;
- }
-
- public boolean isAutoCommit() {
- return autoCommit;
- }
-
- /**
- * If true, each producer operation will be automatically followed by a commit
- */
- public void setAutoCommit(boolean autoCommit) {
- this.autoCommit = autoCommit;
- }
-
- public SolrClient getSolrClient() {
- return solrClient;
- }
-
- /**
- * Uses the provided solr client to connect to solr. When this parameter is not specified, camel applies the
- * following rules to determine the SolrClient: 1) when zkHost or zkChroot (=zookeeper root) parameter is set, then
- * the CloudSolrClient is used. 2) when multiple hosts are specified in the uri (separated with a comma), then the
- * CloudSolrClient (uri scheme is 'solrCloud') or the LBHttpSolrClient (uri scheme is not 'solrCloud') is used. 3)
- * when the solr operation is INSERT_STREAMING, then the ConcurrentUpdateSolrClient is used. 4) otherwise, the
- * HttpSolrClient is used. Note: A CloudSolrClient should point to zookeeper endpoint(s); other clients point to
- * Solr endpoint(s). The SolrClient can also be set via the exchange header 'CamelSolrClient'.
- */
- public void setSolrClient(SolrClient solrClient) {
- this.solrClient = solrClient;
- }
-
- public HttpClient getHttpClient() {
- return httpClient;
- }
-
- /**
- * Sets the http client to be used by the solrClient. This is only applicable when solrClient is not set.
- */
- public void setHttpClient(HttpClient httpClient) {
- this.httpClient = httpClient;
- }
-
- public boolean getUseConcurrentUpdateSolrClient() {
- return useConcurrentUpdateSolrClient;
- }
-
- void setUseConcurrentUpdateSolrClient(boolean useConcurrentUpdateSolrClient) {
- this.useConcurrentUpdateSolrClient = useConcurrentUpdateSolrClient;
- }
-
- public SolrEndpoint getSolrEndpoint() {
- return solrEndpoint;
- }
-
- void setSolrEndpoint(SolrEndpoint solrEndpoint) {
- this.solrEndpoint = solrEndpoint;
- }
-
- public SolrConfiguration deepCopy() {
- try {
- return (SolrConfiguration) this.clone();
- } catch (CloneNotSupportedException e) {
- LOG.error(
- String.format(
- "Could not generate new configuration based on configuration of existing endpoint %s",
- getSolrEndpoint()),
- e);
- }
- return null;
- }
-
- public enum SolrScheme {
-
- SOLR("solr:", "http://"),
- SOLRS("solrs:", "https://"),
- SOLRCLOUD("solrCloud:", "");
-
- private final String uri;
- private final String scheme;
-
- SolrScheme(String uri, String scheme) {
- this.uri = uri;
- this.scheme = scheme;
- }
-
- public SolrScheme getFrom(String endpointUri) {
- for (SolrScheme solrScheme : SolrScheme.values()) {
- if (endpointUri.startsWith(solrScheme.uri)) {
- return solrScheme;
- }
- }
- throw new IllegalArgumentException("Invalid endpoint uri");
- }
-
- public String getUri() {
- return uri;
- }
-
- public String getScheme() {
- return scheme;
- }
-
- }
-
-}
diff --git a/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrConstants.java b/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrConstants.java
deleted file mode 100644
index fff9447770b..00000000000
--- a/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrConstants.java
+++ /dev/null
@@ -1,54 +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.camel.component.solr;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.spi.Metadata;
-
-public final class SolrConstants {
-
- @Metadata(description = "The client.", javaType = "org.apache.solr.client.solrj.SolrClient")
- public static final String CLIENT = "CamelSolrClient";
- @Metadata(description = "The collection to execute the request again.", javaType = "String")
- public static final String COLLECTION = "CamelSolrCollection";
- public static final String FIELD = "SolrField.";
- @Metadata(description = "The operation to perform.", javaType = "String")
- public static final String OPERATION = "SolrOperation";
- public static final String OPERATION_COMMIT = "COMMIT";
- public static final String OPERATION_SOFT_COMMIT = "SOFT_COMMIT";
- public static final String OPERATION_ROLLBACK = "ROLLBACK";
- public static final String OPERATION_OPTIMIZE = "OPTIMIZE";
- public static final String OPERATION_INSERT = "INSERT";
- public static final String OPERATION_INSERT_STREAMING = "INSERT_STREAMING";
- public static final String OPERATION_ADD_BEAN = "ADD_BEAN";
- public static final String OPERATION_ADD_BEANS = "ADD_BEANS";
- public static final String OPERATION_DELETE_BY_ID = "DELETE_BY_ID";
- public static final String OPERATION_DELETE_BY_QUERY = "DELETE_BY_QUERY";
- public static final String OPERATION_QUERY = "QUERY";
- public static final String PARAM = "SolrParam.";
- @Metadata(description = "The query to execute.", javaType = "String")
- public static final String QUERY_STRING = "CamelSolrQueryString";
- @Metadata(description = "The content type.", javaType = "String")
- public static final String CONTENT_TYPE = Exchange.CONTENT_TYPE;
-
- public static final int DEFUALT_STREAMING_QUEUE_SIZE = 10;
- public static final int DEFAULT_STREAMING_THREAD_COUNT = 2;
-
- private SolrConstants() {
- throw new AssertionError();
- }
-}
diff --git a/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrEndpoint.java b/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrEndpoint.java
deleted file mode 100644
index 04c3e49ad68..00000000000
--- a/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrEndpoint.java
+++ /dev/null
@@ -1,97 +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.camel.component.solr;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.camel.Category;
-import org.apache.camel.Consumer;
-import org.apache.camel.Processor;
-import org.apache.camel.Producer;
-import org.apache.camel.RuntimeCamelException;
-import org.apache.camel.spi.UriEndpoint;
-import org.apache.camel.spi.UriParam;
-import org.apache.camel.support.DefaultEndpoint;
-
-/**
- * Perform operations against Apache Lucene Solr.
- */
-@UriEndpoint(firstVersion = "2.9.0", scheme = "solr,solrs,solrCloud", title = "Solr", syntax = "solr:url", producerOnly = true,
- category = { Category.MONITORING, Category.SEARCH }, headersClass = SolrConstants.class)
-public class SolrEndpoint extends DefaultEndpoint {
-
- @UriParam
- private SolrConfiguration solrConfiguration;
-
- private final Map<String, SolrConfiguration> solrConfigurationsMap = new HashMap<>();
-
- public SolrEndpoint(String endpointUri, SolrComponent component, SolrConfiguration solrConfiguration) {
- super(endpointUri, component);
- solrConfiguration.setSolrEndpoint(this);
- this.solrConfiguration = solrConfiguration;
- this.solrConfigurationsMap.put(SolrConstants.OPERATION, solrConfiguration);
- }
-
- public void setZkHost(String zkHost) {
- try {
- String decoded = URLDecoder.decode(zkHost, "UTF-8");
- this.solrConfiguration.setZkHost(decoded);
- } catch (UnsupportedEncodingException e) {
- throw new RuntimeCamelException(e);
- }
- }
-
- public SolrConfiguration getSolrConfiguration() {
- return getSolrConfiguration(null);
- }
-
- public SolrConfiguration getSolrConfiguration(String solrOperation) {
- if (solrConfigurationsMap.containsKey(solrOperation)) {
- return solrConfigurationsMap.get(solrOperation);
- }
- SolrConfiguration newSolrConfiguration = SolrClientHandler.initializeFor(solrOperation, solrConfiguration);
- solrConfigurationsMap.put(solrOperation, newSolrConfiguration);
- return newSolrConfiguration;
- }
-
- public void setRequestHandler(String requestHandler) {
- solrConfiguration.setRequestHandler(requestHandler);
- }
-
- @Override
- public SolrComponent getComponent() {
- return (SolrComponent) super.getComponent();
- }
-
- @Override
- public Producer createProducer() throws Exception {
- return new SolrProducer(this);
- }
-
- protected void onProducerShutdown(SolrProducer producer) {
- getComponent().closeSolrClient(producer);
- }
-
- @Override
- public Consumer createConsumer(Processor processor) throws Exception {
- throw new UnsupportedOperationException("Consumer not supported for Solr endpoint.");
- }
-
-}
diff --git a/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrProducer.java b/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrProducer.java
deleted file mode 100644
index f8ca82b0667..00000000000
--- a/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrProducer.java
+++ /dev/null
@@ -1,302 +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.camel.component.solr;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-import jakarta.activation.MimetypesFileTypeMap;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.WrappedFile;
-import org.apache.camel.support.DefaultProducer;
-import org.apache.camel.util.ObjectHelper;
-import org.apache.solr.client.solrj.SolrClient;
-import org.apache.solr.client.solrj.SolrQuery;
-import org.apache.solr.client.solrj.SolrServerException;
-import org.apache.solr.client.solrj.request.AbstractUpdateRequest.ACTION;
-import org.apache.solr.client.solrj.request.ContentStreamUpdateRequest;
-import org.apache.solr.client.solrj.request.DirectXmlRequest;
-import org.apache.solr.client.solrj.request.QueryRequest;
-import org.apache.solr.client.solrj.request.UpdateRequest;
-import org.apache.solr.client.solrj.response.QueryResponse;
-import org.apache.solr.common.SolrException;
-import org.apache.solr.common.SolrInputDocument;
-import org.apache.solr.common.params.ModifiableSolrParams;
-
-/**
- * The Solr producer.
- */
-public class SolrProducer extends DefaultProducer {
-
- public SolrProducer(SolrEndpoint endpoint) {
- super(endpoint);
- }
-
- @Override
- public void process(Exchange exchange) throws Exception {
-
- String operation = (String) exchange.getIn().getHeader(SolrConstants.OPERATION);
- if (operation == null) {
- throw new IllegalArgumentException(SolrConstants.OPERATION + " header is missing");
- }
-
- // solr configuration
- SolrConfiguration solrConfiguration = getEndpoint().getSolrConfiguration(operation);
-
- // solr client
- SolrClient solrClient = exchange.getIn().getHeader(SolrConstants.CLIENT, SolrClient.class);
- if (solrClient == null) {
- solrClient = getEndpoint().getComponent().getSolrClient(this, solrConfiguration);
- }
-
- // solr parameters
- ModifiableSolrParams solrParams = new ModifiableSolrParams();
- for (Map.Entry<String, Object> entry : exchange.getIn().getHeaders().entrySet()) {
- if (entry.getKey().startsWith(SolrConstants.PARAM)) {
- String paramName = entry.getKey().substring(SolrConstants.PARAM.length());
- solrParams.add(paramName, entry.getValue().toString());
- }
- }
-
- // solr collection
- String solrCollection = exchange.getIn().getHeader(SolrConstants.COLLECTION, String.class);
-
- // solr operations
- if (operation.equalsIgnoreCase(SolrConstants.OPERATION_INSERT)) {
- insert(exchange, solrClient, solrConfiguration, solrParams);
- if (solrConfiguration.isAutoCommit()) {
- commit(exchange, solrClient, solrConfiguration, solrParams);
- }
- } else if (operation.equalsIgnoreCase(SolrConstants.OPERATION_INSERT_STREAMING)) {
- insert(exchange, solrClient, solrConfiguration, solrParams);
- if (solrConfiguration.isAutoCommit()) {
- commit(exchange, solrClient, solrConfiguration, solrParams);
- }
- } else if (operation.equalsIgnoreCase(SolrConstants.OPERATION_DELETE_BY_ID)) {
- UpdateRequest updateRequest = createUpdateRequest(solrConfiguration, solrParams);
- updateRequest.deleteById(exchange.getIn().getBody(String.class));
- updateRequest.process(solrClient, solrCollection);
- if (solrConfiguration.isAutoCommit()) {
- commit(exchange, solrClient, solrConfiguration, solrParams);
- }
- } else if (operation.equalsIgnoreCase(SolrConstants.OPERATION_DELETE_BY_QUERY)) {
- UpdateRequest updateRequest = createUpdateRequest(solrConfiguration, solrParams);
- updateRequest.deleteByQuery(exchange.getIn().getBody(String.class));
- updateRequest.process(solrClient, solrCollection);
- if (solrConfiguration.isAutoCommit()) {
- commit(exchange, solrClient, solrConfiguration, solrParams);
- }
- } else if (operation.equalsIgnoreCase(SolrConstants.OPERATION_ADD_BEAN)) {
- UpdateRequest updateRequest = createUpdateRequest(solrConfiguration, solrParams);
- updateRequest.add(solrClient.getBinder().toSolrInputDocument(exchange.getIn().getBody()));
- updateRequest.process(solrClient, solrCollection);
- if (solrConfiguration.isAutoCommit()) {
- commit(exchange, solrClient, solrConfiguration, solrParams);
- }
- } else if (operation.equalsIgnoreCase(SolrConstants.OPERATION_ADD_BEANS)) {
- UpdateRequest updateRequest = createUpdateRequest(solrConfiguration, solrParams);
- Collection<Object> body = exchange.getIn().getBody(Collection.class);
- updateRequest.add(body.stream().map(solrClient.getBinder()::toSolrInputDocument).collect(Collectors.toList()));
- updateRequest.process(solrClient, solrCollection);
- if (solrConfiguration.isAutoCommit()) {
- commit(exchange, solrClient, solrConfiguration, solrParams);
- }
- } else if (operation.equalsIgnoreCase(SolrConstants.OPERATION_COMMIT)) {
- commit(exchange, solrClient, solrConfiguration, solrParams);
- } else if (operation.equalsIgnoreCase(SolrConstants.OPERATION_SOFT_COMMIT)) {
- commit(exchange, solrClient, solrConfiguration, solrParams, true);
- } else if (operation.equalsIgnoreCase(SolrConstants.OPERATION_ROLLBACK)) {
- UpdateRequest updateRequest = createUpdateRequest(solrConfiguration, solrParams);
- updateRequest.rollback();
- updateRequest.process(solrClient, solrCollection);
- if (solrConfiguration.isAutoCommit()) {
- commit(exchange, solrClient, solrConfiguration, solrParams);
- }
- } else if (operation.equalsIgnoreCase(SolrConstants.OPERATION_OPTIMIZE)) {
- UpdateRequest updateRequest = createUpdateRequest(solrConfiguration, solrParams);
- updateRequest.setAction(ACTION.OPTIMIZE, true, true, 1);
- updateRequest.process(solrClient, solrCollection);
- if (solrConfiguration.isAutoCommit()) {
- commit(exchange, solrClient, solrConfiguration, solrParams);
- }
- } else if (operation.equalsIgnoreCase(SolrConstants.OPERATION_QUERY)) {
- query(exchange, solrClient, solrConfiguration, solrParams);
- } else {
- throw new IllegalArgumentException(
- SolrConstants.OPERATION + " header value '" + operation + "' is not supported");
- }
- }
-
- private void commit(
- Exchange exchange,
- SolrClient solrClient,
- SolrConfiguration solrConfiguration,
- ModifiableSolrParams solrParams)
- throws SolrServerException, IOException {
- commit(exchange, solrClient, solrConfiguration, solrParams, false);
- }
-
- private void commit(
- Exchange exchange,
- SolrClient solrClient,
- SolrConfiguration solrConfiguration,
- ModifiableSolrParams solrParams,
- boolean softCommit)
- throws SolrServerException, IOException {
- String solrCollection = exchange.getIn().getHeader(SolrConstants.COLLECTION, String.class);
- UpdateRequest updateRequest = createUpdateRequest(solrConfiguration, solrParams);
- updateRequest.setAction(
- ACTION.COMMIT,
- solrParams.getBool("waitFlush", true),
- solrParams.getBool("waitSearcher", true),
- softCommit);
- updateRequest.process(solrClient, solrCollection);
- }
-
- private void query(
- Exchange exchange, SolrClient solrClient, SolrConfiguration solrConfiguration, ModifiableSolrParams solrParams)
- throws SolrServerException, IOException {
- String solrCollection = exchange.getIn().getHeader(SolrConstants.COLLECTION, String.class);
- SolrQuery solrQuery = new SolrQuery();
- if (ObjectHelper.isNotEmpty(exchange.getMessage().getHeader(SolrConstants.QUERY_STRING))) {
- solrQuery.setQuery(exchange.getMessage().getHeader(SolrConstants.QUERY_STRING, String.class));
- } else {
- throw new IllegalArgumentException("Query String needs to be set as header while querying Solr");
- }
- solrQuery.add(solrParams);
- QueryRequest queryRequest = new QueryRequest(solrQuery);
- queryRequest.setBasicAuthCredentials(solrConfiguration.getUsername(), solrConfiguration.getPassword());
- QueryResponse p = queryRequest.process(solrClient, solrCollection);
- exchange.getMessage().setBody(p.getResults());
- }
-
- private void insert(
- Exchange exchange, SolrClient solrClient, SolrConfiguration solrConfiguration, ModifiableSolrParams solrParams)
- throws Exception {
- String solrCollection = exchange.getIn().getHeader(SolrConstants.COLLECTION, String.class);
- Object body = exchange.getIn().getBody();
- boolean invalid = false;
- if (body instanceof WrappedFile) {
- body = ((WrappedFile<?>) body).getFile();
- }
- if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(SolrConstants.CONTENT_TYPE, String.class))) {
- String mimeType = exchange.getIn().getHeader(SolrConstants.CONTENT_TYPE, String.class);
- ContentStreamUpdateRequest updateRequest = new ContentStreamUpdateRequest(getRequestHandler(solrConfiguration));
- updateRequest.setParams(solrParams);
- updateRequest.setBasicAuthCredentials(solrConfiguration.getUsername(), solrConfiguration.getPassword());
- updateRequest.addFile((File) body, mimeType);
- updateRequest.process(solrClient, solrCollection);
- } else {
- if (body instanceof File) {
- MimetypesFileTypeMap mimeTypesMap = new MimetypesFileTypeMap();
- String mimeType = mimeTypesMap.getContentType((File) body);
- ContentStreamUpdateRequest updateRequest = new ContentStreamUpdateRequest(getRequestHandler(solrConfiguration));
- updateRequest.setParams(solrParams);
- updateRequest.setBasicAuthCredentials(solrConfiguration.getUsername(), solrConfiguration.getPassword());
- updateRequest.addFile((File) body, mimeType);
- updateRequest.process(solrClient, solrCollection);
- } else if (body instanceof SolrInputDocument) {
- UpdateRequest updateRequest = createUpdateRequest(solrConfiguration, solrParams);
- updateRequest.add((SolrInputDocument) body);
- updateRequest.process(solrClient, solrCollection);
- } else if (body instanceof List<?>) {
- List<?> list = (List<?>) body;
- if (!list.isEmpty() && list.get(0) instanceof SolrInputDocument) {
- UpdateRequest updateRequest = createUpdateRequest(solrConfiguration, solrParams);
- updateRequest.add((List<SolrInputDocument>) list);
- updateRequest.process(solrClient, solrCollection);
- } else {
- invalid = true;
- }
- } else {
- boolean hasSolrHeaders = false;
- for (Map.Entry<String, Object> entry : exchange.getIn().getHeaders().entrySet()) {
- if (entry.getKey().startsWith(SolrConstants.FIELD)) {
- hasSolrHeaders = true;
- break;
- }
- }
- if (hasSolrHeaders) {
- UpdateRequest updateRequest = createUpdateRequest(solrConfiguration, solrParams);
- SolrInputDocument doc = new SolrInputDocument();
- for (Map.Entry<String, Object> entry : exchange.getIn().getHeaders().entrySet()) {
- if (entry.getKey().startsWith(SolrConstants.FIELD)) {
- String fieldName = entry.getKey().substring(SolrConstants.FIELD.length());
- doc.setField(fieldName, entry.getValue());
- }
- }
- updateRequest.add(doc);
- updateRequest.process(solrClient, solrCollection);
- } else if (body instanceof String) {
- String bodyAsString = (String) body;
- if (!bodyAsString.startsWith("<add")) {
- bodyAsString = "<add>" + bodyAsString + "</add>";
- }
- DirectXmlRequest xmlRequest = new DirectXmlRequest(getRequestHandler(solrConfiguration), bodyAsString);
- xmlRequest.setParams(solrParams);
- xmlRequest.setBasicAuthCredentials(solrConfiguration.getUsername(), solrConfiguration.getPassword());
- xmlRequest.process(solrClient, solrCollection);
- } else if (body instanceof Map) {
- UpdateRequest updateRequest = createUpdateRequest(solrConfiguration, solrParams);
- SolrInputDocument doc = new SolrInputDocument();
- Map<String, Object> bodyMap = (Map<String, Object>) body;
- for (Map.Entry<String, Object> entry : bodyMap.entrySet()) {
- doc.setField(entry.getKey(), entry.getValue());
- }
- updateRequest.add(doc);
- updateRequest.process(solrClient, solrCollection);
- } else {
- invalid = true;
- }
- }
- }
-
- if (invalid) {
- throw new SolrException(
- SolrException.ErrorCode.BAD_REQUEST,
- "unable to find data in Exchange to update Solr");
- }
- }
-
- private String getRequestHandler(SolrConfiguration solrConfiguration) {
- String requestHandler = solrConfiguration.getRequestHandler();
- return (requestHandler == null) ? "/update" : requestHandler;
- }
-
- private UpdateRequest createUpdateRequest(SolrConfiguration solrConfiguration, ModifiableSolrParams solrParams) {
- UpdateRequest updateRequest = new UpdateRequest(getRequestHandler(solrConfiguration));
- updateRequest.setParams(solrParams);
- updateRequest.setBasicAuthCredentials(solrConfiguration.getUsername(), solrConfiguration.getPassword());
- return updateRequest;
- }
-
- @Override
- public SolrEndpoint getEndpoint() {
- return (SolrEndpoint) super.getEndpoint();
- }
-
- @Override
- protected void doShutdown() throws Exception {
- getEndpoint().onProducerShutdown(this);
- }
-
-}
diff --git a/components/camel-solr/src/test/java/org/apache/camel/component/solr/InitSolrEndpointTest.java b/components/camel-solr/src/test/java/org/apache/camel/component/solr/InitSolrEndpointTest.java
deleted file mode 100644
index 34ffb6c9340..00000000000
--- a/components/camel-solr/src/test/java/org/apache/camel/component/solr/InitSolrEndpointTest.java
+++ /dev/null
@@ -1,138 +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.camel.component.solr;
-
-import java.util.stream.Stream;
-
-import org.apache.camel.ResolveEndpointFailedException;
-import org.apache.http.client.HttpClient;
-import org.apache.solr.client.solrj.SolrClient;
-import org.apache.solr.client.solrj.impl.CloudSolrClient;
-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.common.params.ModifiableSolrParams;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.params.ParameterizedTest;
-import org.junit.jupiter.params.provider.Arguments;
-import org.junit.jupiter.params.provider.EnumSource;
-import org.junit.jupiter.params.provider.MethodSource;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertThrows;
-
-public class InitSolrEndpointTest extends SolrTestSupport {
-
- private String solrUrl = "solr://localhost:" + getPort() + "/solr";
-
- @Test
- public void endpointCreatedCorrectlyWithAllOptions() {
- HttpClient httpClient = HttpClientUtil.createClient(new ModifiableSolrParams());
- context.getRegistry().bind("http", httpClient);
- SolrClient httpSolrClient = new HttpSolrClient.Builder(solrUrl).build();
- context.getRegistry().bind("client", httpSolrClient);
- SolrEndpoint solrEndpoint = context.getEndpoint(solrUrl + getFullOptions(), SolrEndpoint.class);
- assertEquals(5, solrEndpoint.getSolrConfiguration().getStreamingQueueSize(), "queue size incorrect");
- assertEquals(1, solrEndpoint.getSolrConfiguration().getStreamingThreadCount(), "thread count incorrect");
- assertNotNull(solrEndpoint);
- }
-
- @Test
- public void streamingEndpointCreatedCorrectly() {
- SolrEndpoint solrEndpoint = context.getEndpoint(solrUrl, SolrEndpoint.class);
- assertNotNull(solrEndpoint);
- assertEquals(SolrConstants.DEFUALT_STREAMING_QUEUE_SIZE, solrEndpoint.getSolrConfiguration().getStreamingQueueSize(),
- "queue size incorrect");
- assertEquals(SolrConstants.DEFAULT_STREAMING_THREAD_COUNT,
- solrEndpoint.getSolrConfiguration().getStreamingThreadCount(),
- "thread count incorrect");
- }
-
- @Test
- public void wrongURLFormatFailsEndpointCreation() {
- assertThrows(ResolveEndpointFailedException.class,
- () -> context.getEndpoint("solr://localhost:x99/solr"));
- }
-
- @ParameterizedTest
- @EnumSource(SolrConfiguration.SolrScheme.class)
- public void endpointWithSolrAndHttpClient(SolrConfiguration.SolrScheme solrScheme) throws Exception {
- String solrClientBaseUrl = "http://localhost:8983/solr/collection1";
- String solrEndpointUri = solrClientBaseUrl.replace("http://", solrScheme.getUri());
- // httpClient
- HttpClient httpClient = HttpClientUtil.createClient(new ModifiableSolrParams());
- context.getRegistry().bind("http", httpClient);
- SolrEndpoint solrEndpoint = context.getEndpoint(solrEndpointUri.concat("?httpClient=#http"), SolrEndpoint.class);
- SolrClient solrClient = solrEndpoint.getComponent().getSolrClient(
- (SolrProducer) solrEndpoint.createProducer(),
- solrEndpoint.getSolrConfiguration());
- HttpClient httpClient1 = solrClient instanceof CloudSolrClient
- ? ((CloudSolrClient) solrClient).getHttpClient() : ((HttpSolrClient) solrClient).getHttpClient();
- assertNotNull(httpClient1);
- assertEquals(httpClient, httpClient1);
- // solrClient
- SolrClient httpSolrClient = new HttpSolrClient.Builder(solrClientBaseUrl).build();
- context.getRegistry().bind("client", httpSolrClient);
- solrEndpoint = context.getEndpoint(solrEndpointUri.concat("?solrClient=#client"), SolrEndpoint.class);
- assertNotNull(solrEndpoint.getSolrConfiguration().getSolrClient());
- assertEquals(httpSolrClient, solrEndpoint.getSolrConfiguration().getSolrClient());
- }
-
- @ParameterizedTest
- @MethodSource("provideSolrEndpointStringsWithExpectedSolrClientClass")
- public void endpointCreatedMatchesExpectedSolrClient(
- String endpointUri, Class expectedSolrClientClass, String expectedZkChroot)
- throws Exception {
- SolrComponent solrComponent = context.getComponent("solr", SolrComponent.class);
- SolrEndpoint solrEndpoint = context.getEndpoint(endpointUri, SolrEndpoint.class);
- SolrClient solrClient = solrComponent.getSolrClient((SolrProducer) solrEndpoint.createProducer(),
- solrEndpoint.getSolrConfiguration());
- assertNotNull(solrClient);
- assertEquals(expectedSolrClientClass, solrClient.getClass());
- assertEquals(expectedZkChroot, solrEndpoint.getSolrConfiguration().getZkChroot());
- }
-
- private static Stream<Arguments> provideSolrEndpointStringsWithExpectedSolrClientClass() {
- return Stream.of(
- Arguments.of("solr:localhost:8983/solr", HttpSolrClient.class, null),
- Arguments.of("solr://localhost:8983/solr", HttpSolrClient.class, null),
- // note: zkChroot will not be used but we can't get it from the client directly, so we need to set it
- Arguments.of("solr://localhost:2181/solr?zkChroot=/mytest", CloudSolrClient.class, "/mytest"),
- Arguments.of("solr://localhost:8983/solr,localhost:8984/solr,localhost:8985/solr", LBHttpSolrClient.class,
- null),
- Arguments.of("solr://localhost:8983/solr?zkHost=zk1:2181", CloudSolrClient.class, null),
- Arguments.of("solr://localhost:8983/solr?zkHost=zk1:2181,zk2:2181,zk3:2181/mytest", CloudSolrClient.class,
- "/mytest"),
- Arguments.of("solr://localhost:8983/solr?zkHost=zk1:2181,zk2:2181,zk3:2181/mytest&zkChroot=/myZkChroot",
- CloudSolrClient.class, "/myZkChroot"),
- Arguments.of("solrCloud:zk1:2181,zk2:2181,zk3:2181", CloudSolrClient.class, null),
- Arguments.of("solrCloud:zk1:2181,zk2:2181,zk3:2181/myZkChroot", CloudSolrClient.class, "/myZkChroot"),
- Arguments.of("solrCloud:zk1,zk2,zk3/myZkChroot", CloudSolrClient.class, "/myZkChroot"));
- }
-
- private String getFullOptions() {
- return "?streamingQueueSize=5&streamingThreadCount=1"
- + "&maxRetries=1&soTimeout=100&connectionTimeout=100"
- + "&defaultMaxConnectionsPerHost=100&maxTotalConnections=100"
- + "&followRedirects=false&allowCompression=true"
- + "&requestHandler=/update"
- + "&solrClient=#client&httpClient=#http&zkChroot=/test"
- + "&username=solr&password=SolrRocks";
- }
-
-}
diff --git a/components/camel-solr/src/test/java/org/apache/camel/component/solr/JettySolrFactory.java b/components/camel-solr/src/test/java/org/apache/camel/component/solr/JettySolrFactory.java
deleted file mode 100644
index d5d20b7eedf..00000000000
--- a/components/camel-solr/src/test/java/org/apache/camel/component/solr/JettySolrFactory.java
+++ /dev/null
@@ -1,139 +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.camel.component.solr;
-
-import java.io.File;
-import java.security.KeyManagementException;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.cert.X509Certificate;
-import java.util.SortedMap;
-
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.X509TrustManager;
-
-import org.apache.http.conn.ssl.TrustSelfSignedStrategy;
-import org.apache.http.ssl.SSLContextBuilder;
-import org.apache.solr.client.solrj.embedded.JettyConfig;
-import org.apache.solr.client.solrj.embedded.JettySolrRunner;
-import org.apache.solr.client.solrj.embedded.SSLConfig;
-import org.eclipse.jetty.servlet.ServletHolder;
-
-// Create embedded's Solrs for testing,
-// based on SolrJettyTestBase
-public final class JettySolrFactory {
-
- public static final File TEST_KEYSTORE = new File("./target/test-classes/solrtest.keystore");
- private static final String TEST_KEYSTORE_PATH = TEST_KEYSTORE.getAbsolutePath();
- private static final String TEST_KEYSTORE_PASSWORD = "secret";
- private static boolean mockedSslClient;
- private static int dataDirNo;
-
- private JettySolrFactory() {
- // Util class
- }
-
- private static SSLConfig buildSSLConfig(boolean useSsl, boolean sslClientAuth) {
- SSLConfig sslConfig = new SSLConfig(
- useSsl, false, TEST_KEYSTORE_PATH, TEST_KEYSTORE_PASSWORD,
- TEST_KEYSTORE_PATH, TEST_KEYSTORE_PASSWORD);
- return sslConfig;
- }
-
- private static void installAllTrustingClientSsl()
- throws KeyManagementException,
- NoSuchAlgorithmException, KeyStoreException {
- SSLContextBuilder builder = new SSLContextBuilder();
- builder.loadTrustMaterial(null, new TrustSelfSignedStrategy());
-
- // // Create a trust manager that does not validate certificate chains
- final TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {
- @Override
- public void checkClientTrusted(final X509Certificate[] chain, final String authType) {
- }
-
- @Override
- public void checkServerTrusted(final X509Certificate[] chain, final String authType) {
- }
-
- @Override
- public X509Certificate[] getAcceptedIssuers() {
- return null;
- }
- } };
- final SSLContext sslContext = SSLContext.getInstance("TLS");
- sslContext.init(null, trustAllCerts, new java.security.SecureRandom());
- SSLContext.setDefault(sslContext);
-
- // // Install the all-trusting trust manager
- // final SSLContext sslContext = SSLContext.getInstance( "SSL" );
- // sslContext.init( null, trustAllCerts, new
- // java.security.SecureRandom() );
- // // Create an ssl socket factory with our all-trusting manager
- // final SSLSocketFactory sslSocketFactory =
- // sslContext.getSocketFactory();
- // HttpsURLConnection.setDefaultSSLSocketFactory(sslSocketFactory);
- }
-
- private static JettySolrRunner createJetty(
- String solrHome, String configFile, String schemaFile,
- String context, boolean stopAtShutdown,
- SortedMap<ServletHolder, String> extraServlets, boolean ssl)
- throws Exception {
- if (!mockedSslClient) {
- installAllTrustingClientSsl();
- mockedSslClient = true;
- }
- // Set appropriate paths for Solr to use.
- System.setProperty("solr.solr.home", solrHome);
- System.setProperty("jetty.testMode", "true");
- System.setProperty("solr.data.dir", "target/test-classes/solr/data" + (dataDirNo++));
- System.setProperty("solr.log.dir", "target/");
-
- // Instruct Solr to keep the index in memory, for faster testing.
- System.setProperty("solr.directoryFactory", "solr.RAMDirectoryFactory");
-
- SSLConfig sslConfig = buildSSLConfig(ssl, false);
-
- context = context == null ? "/solr" : context;
- JettyConfig jettyConfig = new JettyConfig.Builder().setContext(context).setPort(0).stopAtShutdown(false)
- .withServlets(extraServlets).withSSLConfig(sslConfig).build();
- JettySolrRunner jetty = new JettySolrRunner(solrHome, jettyConfig);
-
- jetty.start();
-
- return jetty;
- }
-
- public static JettySolrRunner createJettyTestFixture(boolean useSsl) throws Exception {
- String solrHome = "src/test/resources/solr";
- String configFile = solrHome + "/solr-no-core.xml";
- String schemaFile = solrHome + "/collection1/conf/schema.xml";
- String context = "/solr";
- boolean stopAtShutdown = true;
- SortedMap<ServletHolder, String> extraServlets = null;
-
- if (!useSsl) {
- System.setProperty("tests.jettySsl", "false");
- }
-
- return createJetty(solrHome, configFile, schemaFile, context, stopAtShutdown, extraServlets, useSsl);
-
- }
-
-}
diff --git a/components/camel-solr/src/test/java/org/apache/camel/component/solr/MapBodyManualIT.java b/components/camel-solr/src/test/java/org/apache/camel/component/solr/MapBodyManualIT.java
deleted file mode 100644
index b1248da9afc..00000000000
--- a/components/camel-solr/src/test/java/org/apache/camel/component/solr/MapBodyManualIT.java
+++ /dev/null
@@ -1,77 +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.camel.component.solr;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.camel.EndpointInject;
-import org.apache.camel.Exchange;
-import org.apache.camel.Processor;
-import org.apache.camel.ProducerTemplate;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
-
-@EnabledIfSystemProperty(named = "solr.address", matches = ".*",
- disabledReason = "The Solr address (host:port) was not provided")
-public class MapBodyManualIT extends CamelTestSupport {
-
- @EndpointInject
- private ProducerTemplate template;
-
- @EndpointInject("mock:result")
- private MockEndpoint result;
-
- @SuppressWarnings("unchecked")
- @Test
- public void sendIn() throws Exception {
- result.expectedMessageCount(1);
-
- template.send("direct:start", new Processor() {
-
- @Override
- public void process(Exchange exchange) {
- Map<String, String> map = new HashMap<>();
- map.put("id", "0553579923");
- map.put("cat", "Test");
- map.put("name", "Test");
- map.put("price", "Test");
- map.put("author_t", "Test");
- map.put("series_t", "Test");
- map.put("sequence_i", "3");
- map.put("genre_s", "Test");
- exchange.getIn().setHeader(SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT);
- exchange.getMessage().setBody(map);
- }
- });
-
- MockEndpoint.assertIsSatisfied(context);
- }
-
- @Override
- protected RouteBuilder createRouteBuilder() {
- return new RouteBuilder() {
- @Override
- public void configure() {
- from("direct:start").to("{{solr.address}}").to("mock:result");
- }
- };
- }
-}
diff --git a/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrAddBeanTest.java b/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrAddBeanTest.java
deleted file mode 100644
index e233d6a457e..00000000000
--- a/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrAddBeanTest.java
+++ /dev/null
@@ -1,48 +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.camel.component.solr;
-
-import org.apache.camel.test.junit5.params.Test;
-import org.apache.solr.client.solrj.beans.Field;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-
-public class SolrAddBeanTest extends SolrComponentTestSupport {
-
- @Test
- public void testAddBean() throws Exception {
-
- //add bean
- Item item = new Item();
- item.id = TEST_ID;
- item.categories = new String[] { "aaa", "bbb", "ccc" };
-
- template.sendBodyAndHeader("direct:start", item, SolrConstants.OPERATION, SolrConstants.OPERATION_ADD_BEAN);
- template.sendBodyAndHeader("direct:start", null, SolrConstants.OPERATION, SolrConstants.OPERATION_COMMIT);
-
- //verify
- assertEquals(1, executeSolrQuery("id:" + TEST_ID).getResults().getNumFound(), "wrong number of entries found");
- }
-
- public class Item {
- @Field
- String id;
-
- @Field("cat")
- String[] categories;
- }
-}
diff --git a/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrAddBeansTest.java b/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrAddBeansTest.java
deleted file mode 100644
index cdf21ba10dc..00000000000
--- a/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrAddBeansTest.java
+++ /dev/null
@@ -1,62 +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.camel.component.solr;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.camel.test.junit5.params.Test;
-import org.apache.solr.client.solrj.beans.Field;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-
-public class SolrAddBeansTest extends SolrComponentTestSupport {
-
- @Test
- public void testAddBeans() throws Exception {
-
- List<Item> beans = new ArrayList<>();
-
- //add bean1
- Item item1 = new Item();
- item1.id = TEST_ID;
- item1.categories = new String[] { "aaa", "bbb", "ccc" };
- beans.add(item1);
-
- //add bean2
- Item item2 = new Item();
- item2.id = TEST_ID2;
- item2.categories = new String[] { "aaa", "bbb", "ccc" };
- beans.add(item2);
-
- template.sendBodyAndHeader("direct:start", beans, SolrConstants.OPERATION, SolrConstants.OPERATION_ADD_BEANS);
- template.sendBodyAndHeader("direct:start", null, SolrConstants.OPERATION, SolrConstants.OPERATION_COMMIT);
-
- //verify
- assertEquals(1, executeSolrQuery("id:" + TEST_ID).getResults().getNumFound(), "wrong number of entries found");
- assertEquals(1, executeSolrQuery("id:" + TEST_ID2).getResults().getNumFound(), "wrong number of entries found");
- assertEquals(2, executeSolrQuery("*:*").getResults().getNumFound(), "wrong number of entries found");
- }
-
- public class Item {
- @Field
- String id;
-
- @Field("cat")
- String[] categories;
- }
-}
diff --git a/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrCloudFixture.java b/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrCloudFixture.java
deleted file mode 100644
index 8b108c4c246..00000000000
--- a/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrCloudFixture.java
+++ /dev/null
@@ -1,173 +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.camel.component.solr;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.stream.Stream;
-
-import org.apache.camel.util.IOHelper;
-import org.apache.log4j.Logger;
-import org.apache.solr.client.solrj.embedded.JettySolrRunner;
-import org.apache.solr.client.solrj.impl.CloudSolrClient;
-import org.apache.solr.client.solrj.request.QueryRequest;
-import org.apache.solr.cloud.MiniSolrCloudCluster;
-import org.apache.solr.common.SolrInputDocument;
-import org.apache.solr.common.cloud.SolrZkClient;
-import org.apache.solr.common.params.CollectionParams.CollectionAction;
-import org.apache.solr.common.params.CoreAdminParams;
-import org.apache.solr.common.params.ModifiableSolrParams;
-import org.apache.solr.common.util.NamedList;
-
-public class SolrCloudFixture {
-
- private static final Logger LOG;
- private static final Path TEMP_DIR;
-
- /**
- * Create a temp dir under the maven target folder
- */
- static {
- LOG = Logger.getLogger(SolrCloudFixture.class);
- TEMP_DIR = Paths.get("target", "tmp");
- try {
- Files.createDirectories(TEMP_DIR);
- LOG.info("Created: " + TEMP_DIR);
- } catch (IOException e) {
- LOG.error("Unable to create " + TEMP_DIR, e);
- }
-
- }
-
- MiniSolrCloudCluster miniCluster;
- File testDir;
- SolrZkClient zkClient;
-
- CloudSolrClient solrClient;
-
- public SolrCloudFixture(String solrHome) throws Exception {
- String xml = IOHelper.loadText(new FileInputStream(new File(solrHome, "solr-no-core.xml")));
- miniCluster = new MiniSolrCloudCluster(1, "/solr", TEMP_DIR, xml, null, null);
- String zkAddr = miniCluster.getZkServer().getZkAddress();
- String zkHost = miniCluster.getZkServer().getZkHost();
-
- buildZooKeeper(zkHost, zkAddr, new File(solrHome), "solrconfig.xml", "schema.xml");
- List<JettySolrRunner> jettys = miniCluster.getJettySolrRunners();
- for (JettySolrRunner jetty : jettys) {
- if (!jetty.isRunning()) {
- LOG.warn("JETTY NOT RUNNING!");
- } else {
- LOG.info("JETTY RUNNING AT " + jetty.getBaseUrl() + " PORT " + jetty.getLocalPort());
- }
- }
-
- solrClient = new CloudSolrClient.Builder(Arrays.asList(zkAddr), Optional.empty()).build();
- solrClient.connect();
-
- createCollection(solrClient, "collection1", 1, 1, "conf1");
- Thread.sleep(1000); // takes some time to setup the collection...
- // otherwise you'll get no live solr servers
- solrClient.setDefaultCollection("collection1");
-
- SolrInputDocument doc = new SolrInputDocument();
- doc.setField("id", "1");
-
- solrClient.add(doc);
- solrClient.commit();
- }
-
- public static void putConfig(String confName, SolrZkClient zkClient, File solrhome, final String name)
- throws Exception {
- putConfig(confName, zkClient, solrhome, name, name);
- }
-
- protected NamedList<Object> createCollection(
- CloudSolrClient server, String name, int numShards,
- int replicationFactor, String configName)
- throws Exception {
- ModifiableSolrParams modParams = new ModifiableSolrParams();
- modParams.set(CoreAdminParams.ACTION, CollectionAction.CREATE.name());
- modParams.set("name", name);
- modParams.set("numShards", numShards);
- modParams.set("replicationFactor", replicationFactor);
- modParams.set("collection.configName", configName);
- QueryRequest request = new QueryRequest(modParams);
- request.setPath("/admin/collections");
- return server.request(request);
- }
-
- public static void putConfig(
- String confName, SolrZkClient zkClient, File solrhome, final String srcName,
- String destName)
- throws Exception {
- File file = new File(solrhome, "collection1" + File.separator + "conf" + File.separator + srcName);
- if (!file.exists()) {
- LOG.info("zk skipping " + file.getAbsolutePath() + " because it doesn't exist");
- return;
- }
-
- String destPath = "/configs/" + confName + "/" + destName;
- LOG.info("zk put " + file.getAbsolutePath() + " to " + destPath);
- zkClient.makePath(destPath, file, false, true);
- }
-
- // static to share with distrib test
- public void buildZooKeeper(String zkHost, String zkAddress, File solrhome, String config, String schema)
- throws Exception {
- zkClient = new SolrZkClient(zkAddress, 60000);
-
- Map<String, Object> props = new HashMap<>();
- props.put("configName", "conf1");
-
- // for now, always upload the config and schema to the canonical names
- putConfig("conf1", zkClient, solrhome, config, "solrconfig.xml");
- putConfig("conf1", zkClient, solrhome, schema, "schema.xml");
-
- putConfig("conf1", zkClient, solrhome, "stopwords.txt");
- putConfig("conf1", zkClient, solrhome, "stopwords_en.txt");
- putConfig("conf1", zkClient, solrhome, "protwords.txt");
- putConfig("conf1", zkClient, solrhome, "currency.xml");
- putConfig("conf1", zkClient, solrhome, "enumsConfig.xml");
- putConfig("conf1", zkClient, solrhome, "open-exchange-rates.json");
- putConfig("conf1", zkClient, solrhome, "mapping-ISOLatin1Accent.txt");
- putConfig("conf1", zkClient, solrhome, "old_synonyms.txt");
- putConfig("conf1", zkClient, solrhome, "synonyms.txt");
- putConfig("conf1", zkClient, solrhome, "elevate.xml");
- zkClient.close();
- }
-
- public void teardown() throws Exception {
- solrClient.close();
- miniCluster.shutdown();
- try (Stream<File> stream = Files.walk(TEMP_DIR).sorted(Comparator.reverseOrder()).map(Path::toFile)) {
- stream.forEach(File::delete);
- }
- solrClient = null;
- miniCluster = null;
- }
-
-}
diff --git a/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrComponentTestSupport.java b/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrComponentTestSupport.java
deleted file mode 100644
index 30ef7fb6f31..00000000000
--- a/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrComponentTestSupport.java
+++ /dev/null
@@ -1,131 +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.camel.component.solr;
-
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.test.junit5.params.Parameter;
-import org.apache.camel.test.junit5.params.Parameterized;
-import org.apache.camel.test.junit5.params.Parameters;
-import org.apache.solr.client.solrj.SolrClient;
-import org.apache.solr.client.solrj.SolrQuery;
-import org.apache.solr.client.solrj.SolrServerException;
-import org.apache.solr.client.solrj.request.QueryRequest;
-import org.apache.solr.client.solrj.response.QueryResponse;
-import org.junit.jupiter.api.AfterAll;
-import org.junit.jupiter.api.BeforeAll;
-import org.junit.jupiter.api.BeforeEach;
-
-@Parameterized
-public abstract class SolrComponentTestSupport extends SolrTestSupport {
- protected static final String TEST_ID = "test1";
- protected static final String TEST_ID2 = "test2";
-
- @Parameter
- SolrFixtures.TestServerType serverToTest;
-
- SolrFixtures solrFixtures;
-
- protected void solrInsertTestEntry() {
- solrInsertTestEntry(TEST_ID);
- }
-
- protected static Collection<Object[]> secureOrNot() {
- return Arrays.asList(new Object[][] { { true }, { false } });
- }
-
- SolrFixtures getSolrFixtures() {
- if (solrFixtures == null) {
- solrFixtures = new SolrFixtures(serverToTest);
- }
- return solrFixtures;
- }
-
- String solrRouteUri() {
- return getSolrFixtures().solrRouteUri();
- }
-
- String solrRouteAutocommitUri() {
- return getSolrFixtures().solrRouteAutocommitUri();
- }
-
- protected void solrInsertTestEntry(String id) {
- Map<String, Object> headers = new HashMap<>();
- headers.put(SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT);
- headers.put("SolrField.id", id);
- template.sendBodyAndHeaders("direct:start", "", headers);
- }
-
- protected void solrCommit() {
- template.sendBodyAndHeader("direct:start", "", SolrConstants.OPERATION, SolrConstants.OPERATION_COMMIT);
- }
-
- protected QueryResponse executeSolrQuery(String query) throws SolrServerException, IOException {
- SolrQuery solrQuery = new SolrQuery();
- solrQuery.setQuery(query);
- QueryRequest queryRequest = new QueryRequest(solrQuery);
- queryRequest.setBasicAuthCredentials("solr", "SolrRocks");
- SolrClient solrServer = getSolrFixtures().getServer();
- return queryRequest.process(solrServer, "collection1");
- }
-
- @BeforeAll
- public static void beforeClass() throws Exception {
- SolrFixtures.createSolrFixtures();
- }
-
- @AfterAll
- public static void afterClass() throws Exception {
- SolrFixtures.teardownSolrFixtures();
- }
-
- @Override
- protected RouteBuilder createRouteBuilder() {
- return new RouteBuilder() {
- @Override
- public void configure() {
- from("direct:start").to(solrRouteUri());
- from("direct:splitThenCommit")
- .split(body())
- .to(solrRouteUri())
- .end()
- .setHeader(SolrConstants.OPERATION, constant(SolrConstants.OPERATION_COMMIT))
- .to(solrRouteUri());
- from("direct:startAutoCommit").to(solrRouteAutocommitUri());
- }
- };
- }
-
- @Parameters
- public static Collection<Object[]> serverTypes() {
- Object[][] serverTypes = {
- { SolrFixtures.TestServerType.USE_CLOUD },
- { SolrFixtures.TestServerType.USE_HTTPS },
- { SolrFixtures.TestServerType.USE_HTTP } };
- return Arrays.asList(serverTypes);
- }
-
- @BeforeEach
- public void clearIndex() throws Exception {
- SolrFixtures.clearIndex();
- }
-}
diff --git a/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrDeleteTest.java b/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrDeleteTest.java
deleted file mode 100644
index d08f32493e6..00000000000
--- a/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrDeleteTest.java
+++ /dev/null
@@ -1,77 +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.camel.component.solr;
-
-import java.util.Arrays;
-
-import org.apache.camel.test.junit5.params.Test;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-
-public class SolrDeleteTest extends SolrComponentTestSupport {
-
- @Test
- public void testDeleteById() throws Exception {
-
- //insert, commit and verify
- solrInsertTestEntry();
- solrCommit();
- assertEquals(1, executeSolrQuery("id:" + TEST_ID).getResults().getNumFound(), "wrong number of entries found");
-
- //delete
- template.sendBodyAndHeader("direct:start", TEST_ID, SolrConstants.OPERATION, SolrConstants.OPERATION_DELETE_BY_ID);
- solrCommit();
-
- //verify
- assertEquals(0, executeSolrQuery("id:" + TEST_ID).getResults().getNumFound(), "wrong number of entries found");
- }
-
- @Test
- public void testDeleteListOfIDs() throws Exception {
-
- //insert, commit and verify
- solrInsertTestEntry(TEST_ID);
- solrInsertTestEntry(TEST_ID2);
- solrCommit();
- assertEquals(2, executeSolrQuery("id:test*").getResults().getNumFound(), "wrong number of entries found");
-
- //delete
- template.sendBodyAndHeader("direct:splitThenCommit", Arrays.asList(TEST_ID, TEST_ID2), SolrConstants.OPERATION,
- SolrConstants.OPERATION_DELETE_BY_ID);
-
- //verify
- assertEquals(0, executeSolrQuery("id:test*").getResults().getNumFound(), "wrong number of entries found");
- }
-
- @Test
- public void testDeleteByQuery() throws Exception {
-
- //insert, commit and verify
- solrInsertTestEntry(TEST_ID);
- solrInsertTestEntry(TEST_ID2);
- solrCommit();
- assertEquals(2, executeSolrQuery("id:test*").getResults().getNumFound(), "wrong number of entries found");
-
- //delete
- template.sendBodyAndHeader("direct:start", "id:test*", SolrConstants.OPERATION,
- SolrConstants.OPERATION_DELETE_BY_QUERY);
- solrCommit();
-
- //verify
- assertEquals(0, executeSolrQuery("id:test*").getResults().getNumFound(), "wrong number of entries found");
- }
-}
diff --git a/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrFixtures.java b/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrFixtures.java
deleted file mode 100644
index 1430cce507b..00000000000
--- a/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrFixtures.java
+++ /dev/null
@@ -1,136 +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.camel.component.solr;
-
-import java.io.IOException;
-
-import org.apache.log4j.Logger;
-import org.apache.solr.client.solrj.SolrClient;
-import org.apache.solr.client.solrj.SolrServerException;
-import org.apache.solr.client.solrj.embedded.JettySolrRunner;
-import org.apache.solr.client.solrj.impl.HttpSolrClient;
-import org.apache.solr.client.solrj.request.AbstractUpdateRequest.ACTION;
-import org.apache.solr.client.solrj.request.UpdateRequest;
-
-public class SolrFixtures {
- static Logger log = Logger.getLogger(SolrFixtures.class);
-
- private static JettySolrRunner solrRunner;
- private static JettySolrRunner solrHttpsRunner;
- private static HttpSolrClient solrServer;
- private static HttpSolrClient solrHttpsServer;
- private static SolrCloudFixture cloudFixture;
-
- private static int port;
- private static int httpsPort;
-
- public enum TestServerType {
- USE_HTTP,
- USE_HTTPS,
- USE_CLOUD
- }
-
- TestServerType serverType;
-
- SolrFixtures(TestServerType serverType) {
- this.serverType = serverType;
- }
-
- String solrRouteUri() {
- if (serverType == TestServerType.USE_HTTPS) {
- return "solrs://127.0.0.1:" + httpsPort + "/solr/collection1"
- + "?username=solr&password=SolrRocks";
- } else if (serverType == TestServerType.USE_CLOUD) {
- String zkAddrStr = cloudFixture.miniCluster.getZkServer().getZkAddress();
- return "solrCloud://localhost:" + httpsPort + "/solr?zkHost=" + zkAddrStr
- + "&collection=collection1&username=solr&password=SolrRocks";
- } else {
- return "solr://localhost:" + port + "/solr/collection1"
- + "?username=solr&password=SolrRocks";
- }
- }
-
- String solrRouteAutocommitUri() {
- if (serverType == TestServerType.USE_HTTPS) {
- return "solrs://127.0.0.1:" + httpsPort + "/solr/collection1"
- + "?username=solr&password=SolrRocks&autoCommit=true";
- } else if (serverType == TestServerType.USE_CLOUD) {
- String zkAddrStr = cloudFixture.miniCluster.getZkServer().getZkAddress();
- return "solrCloud://localhost:" + httpsPort + "/solr?zkHost=" + zkAddrStr
- + "&collection=collection1&username=solr&password=SolrRocks&autoCommit=true";
- } else {
- return "solr://localhost:" + port + "/solr/collection1"
- + "?username=solr&password=SolrRocks&autoCommit=true";
- }
- }
-
- SolrClient getServer() {
- if (serverType == TestServerType.USE_HTTPS) {
- return solrHttpsServer;
- } else if (serverType == TestServerType.USE_CLOUD) {
- return cloudFixture.solrClient;
- } else {
- return solrServer;
- }
- }
-
- static void createSolrFixtures() throws Exception {
- solrHttpsRunner = JettySolrFactory.createJettyTestFixture(true);
- httpsPort = solrHttpsRunner.getLocalPort();
- log.info("Started Https Test Server: " + solrHttpsRunner.getBaseUrl());
- solrHttpsServer = new HttpSolrClient.Builder("https://127.0.0.1:" + httpsPort + "/solr")
- .withConnectionTimeout(60000)
- .build();
-
- solrRunner = JettySolrFactory.createJettyTestFixture(false);
- port = solrRunner.getLocalPort();
-
- solrServer = new HttpSolrClient.Builder("http://localhost:" + port + "/solr").build();
-
- log.info("Started Test Server: " + solrRunner.getBaseUrl());
- cloudFixture = new SolrCloudFixture("src/test/resources/solr");
- }
-
- public static void teardownSolrFixtures() throws Exception {
- if (solrRunner != null) {
- solrRunner.stop();
- }
- if (solrHttpsRunner != null) {
- solrHttpsRunner.stop();
- }
- if (cloudFixture != null) {
- cloudFixture.teardown();
- }
- }
-
- public static void clearIndex() throws SolrServerException, IOException {
- UpdateRequest updateRequest = new UpdateRequest();
- updateRequest.setBasicAuthCredentials("solr", "SolrRocks");
- updateRequest.deleteByQuery("*:*");
- updateRequest.setAction(ACTION.COMMIT, true, true);
- if (solrServer != null) {
- // Clear the Solr index.
- updateRequest.process(solrServer, "collection1");
- }
- if (solrHttpsServer != null) {
- updateRequest.process(solrHttpsServer, "collection1");
- }
- if (cloudFixture != null) {
- updateRequest.process(cloudFixture.solrClient);
- }
- }
-}
diff --git a/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrServerMissingTest.java b/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrServerMissingTest.java
deleted file mode 100644
index 40c1451c5a6..00000000000
--- a/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrServerMissingTest.java
+++ /dev/null
@@ -1,47 +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.camel.component.solr;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.builder.RouteBuilder;
-import org.junit.jupiter.api.Test;
-
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-public class SolrServerMissingTest extends SolrTestSupport {
-
- @Test
- public void indexSingleDocumentToNonexistentServer() {
- Exchange exchange = createExchangeWithBody(null);
- exchange.getIn().setHeader(SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT);
- exchange.getIn().setHeader("SolrField.id", "MA147LL/A");
-
- template.send("direct:start", exchange);
-
- assertTrue(exchange.isFailed());
- }
-
- @Override
- protected RouteBuilder createRouteBuilder() {
- return new RouteBuilder() {
- @Override
- public void configure() {
- from("direct:start").to("solr://localhost:" + getPort() + "/missingSolr");
- }
- };
- }
-}
diff --git a/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrTestSupport.java b/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrTestSupport.java
deleted file mode 100644
index 73a03f39a8b..00000000000
--- a/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrTestSupport.java
+++ /dev/null
@@ -1,44 +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.camel.component.solr;
-
-import org.apache.camel.test.AvailablePortFinder;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeAll;
-
-public abstract class SolrTestSupport extends CamelTestSupport {
-
- private static int port;
- private static int httpsPort;
-
- @BeforeAll
- public static void initPort() {
- port = AvailablePortFinder.getNextAvailable();
- httpsPort = AvailablePortFinder.getNextAvailable();
- System.setProperty("jdk.tls.client.protocols", "TLSv1.3");
- System.setProperty("jdk.tls.server.protocols", "TLSv1.3");
- }
-
- protected static int getPort() {
- return port;
- }
-
- protected static int getHttpsPort() {
- return httpsPort;
- }
-
-}
diff --git a/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrTransactionsTest.java b/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrTransactionsTest.java
deleted file mode 100644
index d812b7f88b2..00000000000
--- a/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrTransactionsTest.java
+++ /dev/null
@@ -1,107 +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.camel.component.solr;
-
-import org.apache.camel.CamelExecutionException;
-import org.apache.camel.test.junit5.params.Test;
-import org.apache.solr.client.solrj.impl.BaseHttpSolrClient;
-
-import static org.apache.camel.test.junit5.TestSupport.assertIsInstanceOf;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertThrows;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-public class SolrTransactionsTest extends SolrComponentTestSupport {
-
- @Test
- public void testCommit() throws Exception {
-
- //insert and verify
- solrInsertTestEntry();
- assertEquals(0, executeSolrQuery("id:" + TEST_ID).getResults().getNumFound(), "wrong number of entries found");
-
- //commit
- template.sendBodyAndHeader("direct:start", null, SolrConstants.OPERATION, SolrConstants.OPERATION_COMMIT);
-
- //verify exists after commit
- assertEquals(1, executeSolrQuery("id:" + TEST_ID).getResults().getNumFound(), "wrong number of entries found");
- }
-
- @Test
- public void testSoftCommit() throws Exception {
-
- //insert and verify
- solrInsertTestEntry();
- assertEquals(0, executeSolrQuery("id:" + TEST_ID).getResults().getNumFound(), "wrong number of entries found");
-
- //commit
- template.sendBodyAndHeader("direct:start", null, SolrConstants.OPERATION, SolrConstants.OPERATION_SOFT_COMMIT);
-
- //verify exists after commit
- assertEquals(1, executeSolrQuery("id:" + TEST_ID).getResults().getNumFound(), "wrong number of entries found");
- }
-
- @Test
- public void testRollback() throws Exception {
-
- if (SolrFixtures.TestServerType.USE_CLOUD == getSolrFixtures().serverType) {
- // Twisting expectations in this case as rollback is currently no
- // more supported in SolrCloud mode. See SOLR-4895
- Exception e = assertThrows(CamelExecutionException.class,
- () -> doRollback());
- assertIsInstanceOf(BaseHttpSolrClient.RemoteSolrException.class, e.getCause());
- assertTrue(
- e.getCause().getMessage().contains("Rollback is currently not supported in SolrCloud mode. (SOLR-4895)"));
- } else {
- doRollback();
- }
-
- }
-
- protected void doRollback() throws Exception {
- //insert and verify
- solrInsertTestEntry();
- assertEquals(0, executeSolrQuery("id:" + TEST_ID).getResults().getNumFound(), "wrong number of entries found");
-
- //rollback
- template.sendBodyAndHeader("direct:start", null, SolrConstants.OPERATION, SolrConstants.OPERATION_ROLLBACK);
-
- //verify after rollback
- assertEquals(0, executeSolrQuery("id:" + TEST_ID).getResults().getNumFound(), "wrong number of entries found");
-
- //commit
- template.sendBodyAndHeader("direct:start", null, SolrConstants.OPERATION, SolrConstants.OPERATION_COMMIT);
-
- //verify after commit (again)
- assertEquals(0, executeSolrQuery("id:" + TEST_ID).getResults().getNumFound(), "wrong number of entries found");
- }
-
- @Test
- public void testOptimize() throws Exception {
-
- //insert and verify
- solrInsertTestEntry();
- assertEquals(0, executeSolrQuery("id:" + TEST_ID).getResults().getNumFound(), "wrong number of entries found");
-
- //optimize
- template.sendBodyAndHeader("direct:start", null, SolrConstants.OPERATION, SolrConstants.OPERATION_OPTIMIZE);
-
- //verify exists after optimize
- assertEquals(1, executeSolrQuery("id:" + TEST_ID).getResults().getNumFound(), "wrong number of entries found");
- }
-
-}
diff --git a/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrUpdateAutocommitTest.java b/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrUpdateAutocommitTest.java
deleted file mode 100644
index 303d4e8f8e7..00000000000
--- a/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrUpdateAutocommitTest.java
+++ /dev/null
@@ -1,340 +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.camel.component.solr;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.test.junit5.params.Test;
-import org.apache.solr.client.solrj.impl.BaseHttpSolrClient;
-import org.apache.solr.client.solrj.response.QueryResponse;
-import org.apache.solr.client.solrj.util.ClientUtils;
-import org.apache.solr.common.SolrDocument;
-import org.apache.solr.common.SolrDocumentList;
-import org.apache.solr.common.SolrInputDocument;
-import org.apache.solr.common.params.UpdateParams;
-import org.junit.jupiter.api.BeforeEach;
-
-import static org.apache.camel.test.junit5.TestSupport.assertIsInstanceOf;
-import static org.junit.jupiter.api.Assertions.assertArrayEquals;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertFalse;
-
-public class SolrUpdateAutocommitTest extends SolrComponentTestSupport {
- private SolrEndpoint solrEndpoint;
-
- @Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
- solrEndpoint = getMandatoryEndpoint(solrRouteAutocommitUri(), SolrEndpoint.class);
- }
-
- @Test
- public void testInsertSolrInputDocumentAsXMLWithoutAddRoot() throws Exception {
-
- SolrInputDocument doc = new SolrInputDocument();
- doc.addField("id", "MA147LL/A");
- String docAsXml = ClientUtils.toXML(doc);
- template.sendBodyAndHeader("direct:startAutoCommit", docAsXml, SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT);
-
- QueryResponse response = executeSolrQuery("id:MA147LL/A");
- assertEquals(0, response.getStatus());
- assertEquals(1, response.getResults().getNumFound());
- }
-
- @Test
- public void testInsertSolrInputDocumentAsXMLWithAddRoot() throws Exception {
-
- SolrInputDocument doc = new SolrInputDocument();
- doc.addField("id", "MA147LL/A");
- String docAsXml = "<add>" + ClientUtils.toXML(doc) + "</add>";
- template.sendBodyAndHeader("direct:startAutoCommit", docAsXml, SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT);
-
- QueryResponse response = executeSolrQuery("id:MA147LL/A");
- assertEquals(0, response.getStatus());
- assertEquals(1, response.getResults().getNumFound());
- }
-
- @Test
- public void testInsertSolrInputDocument() throws Exception {
-
- SolrInputDocument doc = new SolrInputDocument();
- doc.addField("id", "MA147LL/A");
- template.sendBodyAndHeader("direct:startAutoCommit", doc, SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT);
-
- QueryResponse response = executeSolrQuery("id:MA147LL/A");
- assertEquals(0, response.getStatus());
- assertEquals(1, response.getResults().getNumFound());
- }
-
- @Test
- public void testInsertSolrInputDocumentList() throws Exception {
- List<SolrInputDocument> docList = new ArrayList<>(2);
-
- SolrInputDocument doc = new SolrInputDocument();
- doc.addField("id", "MA147LL/A");
- docList.add(doc);
-
- doc = new SolrInputDocument();
- doc.addField("id", "KP147LL/A");
- docList.add(doc);
-
- template.sendBodyAndHeader("direct:startAutoCommit", docList, SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT);
-
- QueryResponse response = executeSolrQuery("id:MA147LL/A");
- assertEquals(0, response.getStatus());
- assertEquals(1, response.getResults().getNumFound());
-
- response = executeSolrQuery("id:KP147LL/A");
- assertEquals(0, response.getStatus());
- assertEquals(1, response.getResults().getNumFound());
-
- response = executeSolrQuery("id:KP147LL/ABC");
- assertEquals(0, response.getStatus());
- assertEquals(0, response.getResults().getNumFound());
- }
-
- @Test
- public void testInsertStreaming() throws Exception {
-
- Exchange exchange = createExchangeWithBody(null);
- exchange.getIn().setHeader(SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT_STREAMING);
- exchange.getIn().setHeader("SolrField.id", "MA147LL/A");
- template.send("direct:startAutoCommit", exchange);
-
- Thread.sleep(500);
-
- QueryResponse response = executeSolrQuery("id:MA147LL/A");
- assertEquals(0, response.getStatus());
- assertEquals(1, response.getResults().getNumFound());
- }
-
- @Test
- public void indexSingleDocumentOnlyWithId() throws Exception {
- Exchange exchange = createExchangeWithBody(null);
- exchange.getIn().setHeader(SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT);
- exchange.getIn().setHeader("SolrField.id", "MA147LL/A");
-
- template.send("direct:startAutoCommit", exchange);
-
- // Check things were indexed.
- QueryResponse response = executeSolrQuery("id:MA147LL/A");
-
- assertEquals(0, response.getStatus());
- assertEquals(1, response.getResults().getNumFound());
- }
-
- @Test
- public void caughtSolrExceptionIsHandledElegantly() {
- Exchange exchange = createExchangeWithBody(null);
- exchange.getIn().setHeader(SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT);
- exchange.getIn().setHeader("SolrField.name", "Missing required field throws exception.");
-
- template.send("direct:startAutoCommit", exchange);
-
- //noinspection ThrowableResultOfMethodCallIgnored
- assertIsInstanceOf(BaseHttpSolrClient.RemoteSolrException.class, exchange.getException());
- }
-
- @Test
- public void setHeadersAsSolrFields() throws Exception {
- Exchange exchange = createExchangeWithBody("Body is ignored");
- exchange.getIn().setHeader(SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT);
- exchange.getIn().setHeader("SolrField.id", "MA147LL/A");
- exchange.getIn().setHeader("SolrField.name", "Apple 60 GB iPod with Video Playback Black");
- exchange.getIn().setHeader("SolrField.manu", "Apple Computer Inc.");
-
- template.send("direct:startAutoCommit", exchange);
-
- QueryResponse response = executeSolrQuery("id:MA147LL/A");
-
- assertEquals(0, response.getStatus());
- assertEquals(1, response.getResults().getNumFound());
-
- SolrDocument doc = response.getResults().get(0);
- assertEquals("Apple 60 GB iPod with Video Playback Black", doc.getFieldValue("name"));
- assertEquals("Apple Computer Inc.", doc.getFieldValue("manu"));
- }
-
- @Test
- public void setMultiValuedFieldInHeader() throws Exception {
- String[] categories = { "electronics", "apple" };
- Exchange exchange = createExchangeWithBody("Test body for iPod.");
- exchange.getIn().setHeader(SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT);
- exchange.getIn().setHeader("SolrField.id", "MA147LL/A");
- exchange.getIn().setHeader("SolrField.cat", categories);
-
- template.send("direct:startAutoCommit", exchange);
-
- // Check things were indexed.
- QueryResponse response = executeSolrQuery("id:MA147LL/A");
-
- assertEquals(0, response.getStatus());
- assertEquals(1, response.getResults().getNumFound());
-
- SolrDocument doc = response.getResults().get(0);
- assertArrayEquals(categories, ((List<?>) doc.getFieldValue("cat")).toArray());
- }
-
- @Test
- public void indexDocuments() throws Exception {
- Exchange exchange = createExchangeWithBody(null);
- exchange.getIn().setHeader(SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT);
- exchange.getIn().setHeader("SolrField.id", "MA147LL/A");
- exchange.getIn().setHeader("SolrField.name", "Apple 60 GB iPod with Video Playback Black");
- exchange.getIn().setHeader("SolrField.manu", "Apple Computer Inc.");
- template.send("direct:startAutoCommit", exchange);
-
- QueryResponse afterCommitResponse = executeSolrQuery("*:*");
- assertEquals(0, afterCommitResponse.getStatus());
- assertEquals(1, afterCommitResponse.getResults().getNumFound());
- }
-
- @Test
- public void invalidSolrParametersAreIgnored() throws Exception {
- Exchange exchange = createExchangeWithBody(null);
- exchange.getIn().setHeader(SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT);
- exchange.getIn().setHeader("SolrField.id", "MA147LL/A");
- exchange.getIn().setHeader("SolrField.name", "Apple 60 GB iPod with Video Playback Black");
- exchange.getIn().setHeader("SolrParam.invalid-param", "this is ignored");
-
- template.send("direct:startAutoCommit", exchange);
-
- QueryResponse response = executeSolrQuery("*:*");
- assertEquals(0, response.getStatus());
- assertEquals(1, response.getResults().getNumFound());
- }
-
- @Test
- public void indexDocumentsToCSVUpdateHandlerWithoutParameters() throws Exception {
- solrEndpoint.setRequestHandler("/update/csv");
-
- Exchange exchange = createExchangeWithBody(new File("src/test/resources/data/books.csv"));
- exchange.getIn().setHeader(SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT);
- exchange.getIn().setHeader(SolrConstants.PARAM + UpdateParams.ASSUME_CONTENT_TYPE, "text/csv");
- template.send("direct:startAutoCommit", exchange);
-
- QueryResponse response = executeSolrQuery("*:*");
- assertEquals(0, response.getStatus());
- assertEquals(10, response.getResults().getNumFound());
-
- response = executeSolrQuery("id:0553573403");
- SolrDocument doc = response.getResults().get(0);
- assertEquals("A Game of Thrones", doc.getFieldValue("name"));
- assertEquals(7.99f, doc.getFieldValue("price"));
- }
-
- @Test
- public void queryDocumentsToCSVUpdateHandlerWithoutParameters() {
- solrEndpoint.setRequestHandler("/update/csv");
-
- Exchange exchange = createExchangeWithBody(new File("src/test/resources/data/books.csv"));
- exchange.getIn().setHeader(SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT);
- exchange.getIn().setHeader(SolrConstants.PARAM + UpdateParams.ASSUME_CONTENT_TYPE, "text/csv");
- template.send("direct:startAutoCommit", exchange);
-
- Exchange exchange1 = createExchangeWithBody(null);
- exchange1.getIn().setHeader(SolrConstants.OPERATION, SolrConstants.OPERATION_QUERY);
- exchange1.getIn().setHeader(SolrConstants.QUERY_STRING, "id:0553573403");
- Exchange result = template.send("direct:startAutoCommit", exchange1);
-
- SolrDocumentList list = result.getMessage().getBody(SolrDocumentList.class);
- assertEquals("A Game of Thrones", list.get(0).getFieldValue("name"));
- assertEquals(7.99f, list.get(0).getFieldValue("price"));
- }
-
- @Test
- public void queryDocumentsToMap() throws Exception {
- solrEndpoint.setRequestHandler("/update/csv");
-
- Exchange exchange = createExchangeWithBody(new File("src/test/resources/data/books.csv"));
- exchange.getIn().setHeader(SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT);
- exchange.getIn().setHeader(SolrConstants.PARAM + UpdateParams.ASSUME_CONTENT_TYPE, "text/csv");
- template.send("direct:startAutoCommit", exchange);
-
- // Required to reset request handler:
- // The Map-based insert request used to not respect the requesthandler that was explicitly set on the endpoint:
- // The insert-request was always using '/update' even when '/update/csv' was set on the endpoint.
- // This has now been changed: the explicitly set requesthandler is used.
- solrEndpoint.setRequestHandler(null);
- // 0553579908,book,A Clash of Kings,7.99,true,George R.R. Martin,"A Song of Ice and Fire",2,fantasy
- Exchange exchange1 = createExchangeWithBody(null);
- Map<String, String> map = new HashMap<>();
- map.put("id", "0553579934");
- map.put("cat", "Test");
- map.put("name", "Test");
- map.put("price", "7.99");
- map.put("author_t", "Test");
- map.put("series_t", "Test");
- map.put("sequence_i", "3");
- map.put("genre_s", "Test");
- exchange1.getMessage().setBody(map);
- exchange1.getIn().setHeader(SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT);
- template.send("direct:startAutoCommit", exchange1);
-
- QueryResponse response = executeSolrQuery("id:0553579934");
- assertEquals(0, response.getStatus());
- assertEquals(1, response.getResults().getNumFound());
- }
-
- @Test
- public void indexDocumentsToCSVUpdateHandlerWithParameters() throws Exception {
- solrEndpoint.setRequestHandler("/update/csv");
-
- Exchange exchange = createExchangeWithBody(new File("src/test/resources/data/books.csv"));
- exchange.getIn().setHeader(SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT);
- exchange.getIn().setHeader(SolrConstants.PARAM + UpdateParams.ASSUME_CONTENT_TYPE, "text/csv");
- exchange.getIn().setHeader("SolrParam.fieldnames", "id,cat,name,price,inStock,author_t,series_t,sequence_i,genre_s");
- exchange.getIn().setHeader("SolrParam.skip", "cat,sequence_i,genre_s");
- exchange.getIn().setHeader("SolrParam.skipLines", 1);
-
- template.send("direct:startAutoCommit", exchange);
-
- QueryResponse response = executeSolrQuery("*:*");
- assertEquals(0, response.getStatus());
- assertEquals(10, response.getResults().getNumFound());
-
- SolrDocument doc = response.getResults().get(0);
- assertFalse(doc.getFieldNames().contains("cat"));
- }
-
- @Test
- public void indexPDFDocumentToExtractingRequestHandler() throws Exception {
- solrEndpoint.setRequestHandler("/update/extract");
-
- Exchange exchange = createExchangeWithBody(new File("src/test/resources/data/tutorial.pdf"));
- exchange.getIn().setHeader(SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT);
- exchange.getIn().setHeader("SolrParam.literal.id", "tutorial.pdf");
-
- template.send("direct:startAutoCommit", exchange);
-
- QueryResponse response = executeSolrQuery("*:*");
- assertEquals(0, response.getStatus());
- assertEquals(1, response.getResults().getNumFound());
-
- SolrDocument doc = response.getResults().get(0);
- assertEquals("Solr", doc.getFieldValue("subject"));
- assertEquals("tutorial.pdf", doc.getFieldValue("id"));
- assertEquals(Arrays.asList("application/pdf"), doc.getFieldValue("content_type"));
- }
-}
diff --git a/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrUpdateTest.java b/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrUpdateTest.java
deleted file mode 100644
index 8e2b857dbb5..00000000000
--- a/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrUpdateTest.java
+++ /dev/null
@@ -1,364 +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.camel.component.solr;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.test.junit5.params.Test;
-import org.apache.solr.client.solrj.impl.BaseHttpSolrClient;
-import org.apache.solr.client.solrj.response.QueryResponse;
-import org.apache.solr.client.solrj.util.ClientUtils;
-import org.apache.solr.common.SolrDocument;
-import org.apache.solr.common.SolrDocumentList;
-import org.apache.solr.common.SolrInputDocument;
-import org.apache.solr.common.params.UpdateParams;
-import org.junit.jupiter.api.BeforeEach;
-
-import static org.apache.camel.test.junit5.TestSupport.assertIsInstanceOf;
-import static org.junit.jupiter.api.Assertions.assertArrayEquals;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertFalse;
-
-public class SolrUpdateTest extends SolrComponentTestSupport {
- private SolrEndpoint solrEndpoint;
-
- @Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
- solrEndpoint = getMandatoryEndpoint(solrRouteUri(), SolrEndpoint.class);
- }
-
- @Test
- public void testInsertSolrInputDocumentAsXMLWithoutAddRoot() throws Exception {
-
- SolrInputDocument doc = new SolrInputDocument();
- doc.addField("id", "MA147LL/A");
- String docAsXml = ClientUtils.toXML(doc);
- template.sendBodyAndHeader("direct:start", docAsXml, SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT);
- solrCommit();
-
- QueryResponse response = executeSolrQuery("id:MA147LL/A");
- assertEquals(0, response.getStatus());
- assertEquals(1, response.getResults().getNumFound());
- }
-
- @Test
- public void testInsertSolrInputDocumentAsXMLWithAddRoot() throws Exception {
-
- SolrInputDocument doc = new SolrInputDocument();
- doc.addField("id", "MA147LL/A");
- String docAsXml = "<add>" + ClientUtils.toXML(doc) + "</add>";
- template.sendBodyAndHeader("direct:start", docAsXml, SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT);
- solrCommit();
-
- QueryResponse response = executeSolrQuery("id:MA147LL/A");
- assertEquals(0, response.getStatus());
- assertEquals(1, response.getResults().getNumFound());
- }
-
- @Test
- public void testInsertSolrInputDocument() throws Exception {
-
- SolrInputDocument doc = new SolrInputDocument();
- doc.addField("id", "MA147LL/A");
- template.sendBodyAndHeader("direct:start", doc, SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT);
-
- solrCommit();
-
- QueryResponse response = executeSolrQuery("id:MA147LL/A");
- assertEquals(0, response.getStatus());
- assertEquals(1, response.getResults().getNumFound());
- }
-
- @Test
- public void testInsertSolrInputDocumentList() throws Exception {
- List<SolrInputDocument> docList = new ArrayList<>(2);
-
- SolrInputDocument doc = new SolrInputDocument();
- doc.addField("id", "MA147LL/A");
- docList.add(doc);
-
- doc = new SolrInputDocument();
- doc.addField("id", "KP147LL/A");
- docList.add(doc);
-
- template.sendBodyAndHeader("direct:start", docList, SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT);
-
- solrCommit();
-
- QueryResponse response = executeSolrQuery("id:MA147LL/A");
- assertEquals(0, response.getStatus());
- assertEquals(1, response.getResults().getNumFound());
-
- response = executeSolrQuery("id:KP147LL/A");
- assertEquals(0, response.getStatus());
- assertEquals(1, response.getResults().getNumFound());
-
- response = executeSolrQuery("id:KP147LL/ABC");
- assertEquals(0, response.getStatus());
- assertEquals(0, response.getResults().getNumFound());
- }
-
- @Test
- public void testInsertStreaming() throws Exception {
-
- Exchange exchange = createExchangeWithBody(null);
- exchange.getIn().setHeader(SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT_STREAMING);
- exchange.getIn().setHeader("SolrField.id", "MA147LL/A");
- template.send("direct:start", exchange);
-
- Thread.sleep(500);
-
- solrCommit();
-
- QueryResponse response = executeSolrQuery("id:MA147LL/A");
- assertEquals(0, response.getStatus());
- assertEquals(1, response.getResults().getNumFound());
- }
-
- @Test
- public void indexSingleDocumentOnlyWithId() throws Exception {
- Exchange exchange = createExchangeWithBody(null);
- exchange.getIn().setHeader(SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT);
- exchange.getIn().setHeader("SolrField.id", "MA147LL/A");
-
- template.send("direct:start", exchange);
- solrCommit();
-
- // Check things were indexed.
- QueryResponse response = executeSolrQuery("id:MA147LL/A");
-
- assertEquals(0, response.getStatus());
- assertEquals(1, response.getResults().getNumFound());
- }
-
- @Test
- public void caughtSolrExceptionIsHandledElegantly() {
- Exchange exchange = createExchangeWithBody(null);
- exchange.getIn().setHeader(SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT);
- exchange.getIn().setHeader("SolrField.name", "Missing required field throws exception.");
-
- template.send("direct:start", exchange);
-
- //noinspection ThrowableResultOfMethodCallIgnored
- assertIsInstanceOf(BaseHttpSolrClient.RemoteSolrException.class, exchange.getException());
- }
-
- @Test
- public void setHeadersAsSolrFields() throws Exception {
- Exchange exchange = createExchangeWithBody("Body is ignored");
- exchange.getIn().setHeader(SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT);
- exchange.getIn().setHeader("SolrField.id", "MA147LL/A");
- exchange.getIn().setHeader("SolrField.name", "Apple 60 GB iPod with Video Playback Black");
- exchange.getIn().setHeader("SolrField.manu", "Apple Computer Inc.");
-
- template.send("direct:start", exchange);
- solrCommit();
-
- QueryResponse response = executeSolrQuery("id:MA147LL/A");
-
- assertEquals(0, response.getStatus());
- assertEquals(1, response.getResults().getNumFound());
-
- SolrDocument doc = response.getResults().get(0);
- assertEquals("Apple 60 GB iPod with Video Playback Black", doc.getFieldValue("name"));
- assertEquals("Apple Computer Inc.", doc.getFieldValue("manu"));
- }
-
- @Test
- public void setMultiValuedFieldInHeader() throws Exception {
- String[] categories = { "electronics", "apple" };
- Exchange exchange = createExchangeWithBody("Test body for iPod.");
- exchange.getIn().setHeader(SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT);
- exchange.getIn().setHeader("SolrField.id", "MA147LL/A");
- exchange.getIn().setHeader("SolrField.cat", categories);
-
- template.send("direct:start", exchange);
- solrCommit();
-
- // Check things were indexed.
- QueryResponse response = executeSolrQuery("id:MA147LL/A");
-
- assertEquals(0, response.getStatus());
- assertEquals(1, response.getResults().getNumFound());
-
- SolrDocument doc = response.getResults().get(0);
- assertArrayEquals(categories, ((List<?>) doc.getFieldValue("cat")).toArray());
- }
-
- @Test
- public void indexDocumentsAndThenCommit() throws Exception {
- Exchange exchange = createExchangeWithBody(null);
- exchange.getIn().setHeader(SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT);
- exchange.getIn().setHeader("SolrField.id", "MA147LL/A");
- exchange.getIn().setHeader("SolrField.name", "Apple 60 GB iPod with Video Playback Black");
- exchange.getIn().setHeader("SolrField.manu", "Apple Computer Inc.");
- template.send("direct:start", exchange);
-
- QueryResponse response = executeSolrQuery("*:*");
- assertEquals(0, response.getStatus());
- assertEquals(0, response.getResults().getNumFound());
-
- solrCommit();
-
- QueryResponse afterCommitResponse = executeSolrQuery("*:*");
- assertEquals(0, afterCommitResponse.getStatus());
- assertEquals(1, afterCommitResponse.getResults().getNumFound());
- }
-
- @Test
- public void invalidSolrParametersAreIgnored() throws Exception {
- Exchange exchange = createExchangeWithBody(null);
- exchange.getIn().setHeader(SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT);
- exchange.getIn().setHeader("SolrField.id", "MA147LL/A");
- exchange.getIn().setHeader("SolrField.name", "Apple 60 GB iPod with Video Playback Black");
- exchange.getIn().setHeader("SolrParam.invalid-param", "this is ignored");
-
- template.send("direct:start", exchange);
- solrCommit();
-
- QueryResponse response = executeSolrQuery("*:*");
- assertEquals(0, response.getStatus());
- assertEquals(1, response.getResults().getNumFound());
- }
-
- @Test
- public void indexDocumentsToCSVUpdateHandlerWithoutParameters() throws Exception {
- solrEndpoint.setRequestHandler("/update/csv");
-
- Exchange exchange = createExchangeWithBody(new File("src/test/resources/data/books.csv"));
- exchange.getIn().setHeader(SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT);
- exchange.getIn().setHeader(SolrConstants.PARAM + UpdateParams.ASSUME_CONTENT_TYPE, "text/csv");
- template.send("direct:start", exchange);
- solrCommit();
-
- QueryResponse response = executeSolrQuery("*:*");
- assertEquals(0, response.getStatus());
- assertEquals(10, response.getResults().getNumFound());
-
- response = executeSolrQuery("id:0553573403");
- SolrDocument doc = response.getResults().get(0);
- assertEquals("A Game of Thrones", doc.getFieldValue("name"));
- assertEquals(7.99f, doc.getFieldValue("price"));
- }
-
- @Test
- public void queryDocumentsToCSVUpdateHandlerWithoutParameters() {
- solrEndpoint.setRequestHandler("/update/csv");
-
- Exchange exchange = createExchangeWithBody(new File("src/test/resources/data/books.csv"));
- exchange.getIn().setHeader(SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT);
- exchange.getIn().setHeader(SolrConstants.PARAM + UpdateParams.ASSUME_CONTENT_TYPE, "text/csv");
- template.send("direct:start", exchange);
- solrCommit();
-
- Exchange exchange1 = createExchangeWithBody(null);
- exchange1.getIn().setHeader(SolrConstants.OPERATION, SolrConstants.OPERATION_QUERY);
- exchange1.getIn().setHeader(SolrConstants.QUERY_STRING, "id:0553573403");
- Exchange result = template.send("direct:start", exchange1);
-
- SolrDocumentList list = result.getMessage().getBody(SolrDocumentList.class);
- assertEquals("A Game of Thrones", list.get(0).getFieldValue("name"));
- assertEquals(7.99f, list.get(0).getFieldValue("price"));
- }
-
- @Test
- public void queryDocumentsToMap() throws Exception {
- solrEndpoint.setRequestHandler("/update/csv");
-
- Exchange exchange = createExchangeWithBody(new File("src/test/resources/data/books.csv"));
- exchange.getIn().setHeader(SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT);
- exchange.getIn().setHeader(SolrConstants.PARAM + UpdateParams.ASSUME_CONTENT_TYPE, "text/csv");
- template.send("direct:start", exchange);
- solrCommit();
-
- // Required to reset request handler:
- // The Map-based insert request used to not respect the requesthandler that was explicitly set on the endpoint:
- // The insert-request was always using '/update' even when '/update/csv' was set on the endpoint.
- // This has now been changed: the explicitly set requesthandler is used.
- solrEndpoint.setRequestHandler(null);
- // 0553579908,book,A Clash of Kings,7.99,true,George R.R. Martin,"A Song of Ice and Fire",2,fantasy
- Exchange exchange1 = createExchangeWithBody(null);
- Map<String, String> map = new HashMap<>();
- map.put("id", "0553579934");
- map.put("cat", "Test");
- map.put("name", "Test");
- map.put("price", "7.99");
- map.put("author_t", "Test");
- map.put("series_t", "Test");
- map.put("sequence_i", "3");
- map.put("genre_s", "Test");
- exchange1.getMessage().setBody(map);
- exchange1.getIn().setHeader(SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT);
- template.send("direct:start", exchange1);
- solrCommit();
-
- QueryResponse response = executeSolrQuery("id:0553579934");
- assertEquals(0, response.getStatus());
- assertEquals(1, response.getResults().getNumFound());
- }
-
- @Test
- public void indexDocumentsToCSVUpdateHandlerWithParameters() throws Exception {
- solrEndpoint.setRequestHandler("/update/csv");
-
- Exchange exchange = createExchangeWithBody(new File("src/test/resources/data/books.csv"));
- exchange.getIn().setHeader(SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT);
- exchange.getIn().setHeader(SolrConstants.PARAM + UpdateParams.ASSUME_CONTENT_TYPE, "text/csv");
- exchange.getIn().setHeader("SolrParam.fieldnames", "id,cat,name,price,inStock,author_t,series_t,sequence_i,genre_s");
- exchange.getIn().setHeader("SolrParam.skip", "cat,sequence_i,genre_s");
- exchange.getIn().setHeader("SolrParam.skipLines", 1);
-
- template.send("direct:start", exchange);
- solrCommit();
-
- QueryResponse response = executeSolrQuery("*:*");
- assertEquals(0, response.getStatus());
- assertEquals(10, response.getResults().getNumFound());
-
- SolrDocument doc = response.getResults().get(0);
- assertFalse(doc.getFieldNames().contains("cat"));
- }
-
- @Test
- public void indexPDFDocumentToExtractingRequestHandler() throws Exception {
- solrEndpoint.setRequestHandler("/update/extract");
-
- Exchange exchange = createExchangeWithBody(new File("src/test/resources/data/tutorial.pdf"));
- exchange.getIn().setHeader(SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT);
- exchange.getIn().setHeader("SolrParam.literal.id", "tutorial.pdf");
-
- template.send("direct:start", exchange);
- solrCommit();
-
- QueryResponse response = executeSolrQuery("*:*");
- assertEquals(0, response.getStatus());
- assertEquals(1, response.getResults().getNumFound());
-
- SolrDocument doc = response.getResults().get(0);
- assertEquals("Solr", doc.getFieldValue("subject"));
- assertEquals("tutorial.pdf", doc.getFieldValue("id"));
- assertEquals(Arrays.asList("application/pdf"), doc.getFieldValue("content_type"));
- }
-}
diff --git a/components/camel-solr/src/test/java/org/apache/camel/component/solr/integration/SolrCloudITSupport.java b/components/camel-solr/src/test/java/org/apache/camel/component/solr/integration/SolrCloudITSupport.java
deleted file mode 100644
index 32fe0c8484b..00000000000
--- a/components/camel-solr/src/test/java/org/apache/camel/component/solr/integration/SolrCloudITSupport.java
+++ /dev/null
@@ -1,62 +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.camel.component.solr.integration;
-
-import java.io.IOException;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.component.solr.SolrComponent;
-import org.apache.camel.test.infra.solr.services.SolrLocalContainerCloudService;
-import org.apache.camel.test.infra.solr.services.SolrLocalContainerService;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.apache.solr.client.solrj.SolrClient;
-import org.apache.solr.client.solrj.SolrServerException;
-import org.apache.solr.client.solrj.impl.HttpSolrClient;
-import org.apache.solr.client.solrj.request.CollectionAdminRequest;
-import org.junit.jupiter.api.extension.RegisterExtension;
-
-public class SolrCloudITSupport extends CamelTestSupport {
-
- @RegisterExtension
- static SolrLocalContainerService service = new SolrLocalContainerCloudService();
-
- @Override
- protected CamelContext createCamelContext() throws Exception {
- CamelContext context = super.createCamelContext();
- createCollection("collection1");
- SolrComponent solr = context.getComponent("solr", SolrComponent.class);
- return context;
- }
-
- protected String getSolrUri(String collection) {
- return getSolrUrl(collection).replace("http:", "solr:");
- }
-
- protected String getSolrUrl(String collection) {
- String collectionPath = collection == null ? "" : "/".concat(collection);
- return service
- .getSolrBaseUrl()
- .concat(collectionPath);
- }
-
- public void createCollection(String collection) throws SolrServerException, IOException {
- SolrClient solrClient = new HttpSolrClient.Builder(service.getSolrBaseUrl()).build();
- CollectionAdminRequest.Create creator = CollectionAdminRequest.createCollection(collection, "_default", 1, 1);
- creator.process(solrClient);
- }
-
-}
diff --git a/components/camel-solr/src/test/java/org/apache/camel/component/solr/integration/SolrCloudProducerIT.java b/components/camel-solr/src/test/java/org/apache/camel/component/solr/integration/SolrCloudProducerIT.java
deleted file mode 100644
index 56fe5d56942..00000000000
--- a/components/camel-solr/src/test/java/org/apache/camel/component/solr/integration/SolrCloudProducerIT.java
+++ /dev/null
@@ -1,41 +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.camel.component.solr.integration;
-
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.solr.SolrConstants;
-import org.junit.jupiter.api.Test;
-
-public class SolrCloudProducerIT extends SolrCloudITSupport {
-
- String solrEndpointUri = getSolrUri("collection1");
-
- @Test
- public void sendTest() {
- template.sendBodyAndHeader("direct:send", "pippo", SolrConstants.OPERATION, "COMMIT");
- }
-
- @Override
- protected RouteBuilder createRouteBuilder() {
- return new RouteBuilder() {
- @Override
- public void configure() {
- from("direct:send").to(solrEndpointUri);
- }
- };
- }
-}
diff --git a/components/camel-solr/src/test/java/org/apache/camel/component/solr/integration/SolrITSupport.java b/components/camel-solr/src/test/java/org/apache/camel/component/solr/integration/SolrITSupport.java
deleted file mode 100644
index 856f4389a20..00000000000
--- a/components/camel-solr/src/test/java/org/apache/camel/component/solr/integration/SolrITSupport.java
+++ /dev/null
@@ -1,42 +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.camel.component.solr.integration;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.component.solr.SolrComponent;
-import org.apache.camel.test.infra.solr.services.SolrService;
-import org.apache.camel.test.infra.solr.services.SolrServiceFactory;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.extension.RegisterExtension;
-
-public class SolrITSupport extends CamelTestSupport {
-
- @RegisterExtension
- static SolrService service = SolrServiceFactory.createService();
-
- @Override
- protected CamelContext createCamelContext() throws Exception {
- CamelContext context = super.createCamelContext();
- SolrComponent solr = context.getComponent("solr", SolrComponent.class);
- return context;
- }
-
- protected String getSolrServiceAddress() {
- return service.getSolrBaseUrl();
- }
-
-}
diff --git a/components/camel-solr/src/test/resources/data/books.csv b/components/camel-solr/src/test/resources/data/books.csv
deleted file mode 100644
index cfbc14755c6..00000000000
--- a/components/camel-solr/src/test/resources/data/books.csv
+++ /dev/null
@@ -1,11 +0,0 @@
-id,cat,name,price,inStock,author_t,series_t,sequence_i,genre_s
-0553573403,book,A Game of Thrones,7.99,true,George R.R. Martin,"A Song of Ice and Fire",1,fantasy
-0553579908,book,A Clash of Kings,7.99,true,George R.R. Martin,"A Song of Ice and Fire",2,fantasy
-055357342X,book,A Storm of Swords,7.99,true,George R.R. Martin,"A Song of Ice and Fire",3,fantasy
-0553293354,book,Foundation,7.99,true,Isaac Asimov,Foundation Novels,1,scifi
-0812521390,book,The Black Company,6.99,false,Glen Cook,The Chronicles of The Black Company,1,fantasy
-0812550706,book,Ender's Game,6.99,true,Orson Scott Card,Ender,1,scifi
-0441385532,book,Jhereg,7.95,false,Steven Brust,Vlad Taltos,1,fantasy
-0380014300,book,Nine Princes In Amber,6.99,true,Roger Zelazny,the Chronicles of Amber,1,fantasy
-0805080481,book,The Book of Three,5.99,true,Lloyd Alexander,The Chronicles of Prydain,1,fantasy
-080508049X,book,The Black Cauldron,5.99,true,Lloyd Alexander,The Chronicles of Prydain,2,fantasy
diff --git a/components/camel-solr/src/test/resources/data/books.xml b/components/camel-solr/src/test/resources/data/books.xml
deleted file mode 100644
index 2d66aec36c2..00000000000
--- a/components/camel-solr/src/test/resources/data/books.xml
+++ /dev/null
@@ -1,68 +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.
-
--->
-<!--
- Modified from the example XML file w3schools.com provides for its
- XPath tutorial.
-
- http://www.w3schools.com/xpath/books.xml
--->
-<bookstore>
-
- <book>
- <title lang="en">Everyday Italian</title>
- <author>Giada De Laurentiis</author>
- <year>2005</year>
- <price>30.00</price>
- <cat>Cooking</cat>
- </book>
-
- <book>
- <title lang="en">Harry Potter</title>
- <author>J K. Rowling</author>
- <year>2005</year>
- <price>29.99</price>
- <cat>Children</cat>
- </book>
-
- <book>
- <title lang="en">XQuery Kick Start</title>
- <author>James McGovern</author>
- <author>Per Bothner</author>
- <author>Kurt Cagle</author>
- <author>James Linn</author>
- <author>Vaidyanathan Nagarajan</author>
- <year>2003</year>
- <price>49.99</price>
- <cat>Web</cat>
- <cat>Technology</cat>
- <cat>Computers</cat>
- </book>
-
- <book>
- <title lang="en">Learning XML</title>
- <author>Erik T. Ray</author>
- <year>2003</year>
- <price>39.95</price>
- <cat>Web</cat>
- <cat>Technology</cat>
- <cat>Computers</cat>
- </book>
-
-</bookstore>
diff --git a/components/camel-solr/src/test/resources/data/tutorial.pdf b/components/camel-solr/src/test/resources/data/tutorial.pdf
deleted file mode 100755
index 5db40f10721..00000000000
Binary files a/components/camel-solr/src/test/resources/data/tutorial.pdf and /dev/null differ
diff --git a/components/camel-solr/src/test/resources/log4j2.properties b/components/camel-solr/src/test/resources/log4j2.properties
deleted file mode 100644
index f16ce7c64b3..00000000000
--- a/components/camel-solr/src/test/resources/log4j2.properties
+++ /dev/null
@@ -1,30 +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.
-## ---------------------------------------------------------------------------
-
-appender.file.type = File
-appender.file.name = file
-appender.file.fileName = target/camel-solr-test.log
-appender.file.layout.type = PatternLayout
-appender.file.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n
-appender.stdout.type = Console
-appender.stdout.name = stdout
-appender.stdout.layout.type = PatternLayout
-appender.stdout.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n
-logger.springframework.name = org.springframework
-logger.springframework.level = WARN
-rootLogger.level = INFO
-rootLogger.appenderRef.file.ref = file
diff --git a/components/camel-solr/src/test/resources/solr/collection1/conf/elevate.xml b/components/camel-solr/src/test/resources/solr/collection1/conf/elevate.xml
deleted file mode 100644
index 27474324eed..00000000000
--- a/components/camel-solr/src/test/resources/solr/collection1/conf/elevate.xml
+++ /dev/null
@@ -1,37 +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.
-
--->
-<!-- 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.
--->
-
-<elevate>
- <query text="foo bar">
- <doc id="1" />
- <doc id="2" />
- <doc id="3" />
- </query>
-
- <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>
diff --git a/components/camel-solr/src/test/resources/solr/collection1/conf/protwords.txt b/components/camel-solr/src/test/resources/solr/collection1/conf/protwords.txt
deleted file mode 100644
index 1dfc0abecbf..00000000000
--- a/components/camel-solr/src/test/resources/solr/collection1/conf/protwords.txt
+++ /dev/null
@@ -1,21 +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.
-
-#-----------------------------------------------------------------------
-# 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
-
diff --git a/components/camel-solr/src/test/resources/solr/collection1/conf/schema.xml b/components/camel-solr/src/test/resources/solr/collection1/conf/schema.xml
deleted file mode 100644
index 2948971a0e5..00000000000
--- a/components/camel-solr/src/test/resources/solr/collection1/conf/schema.xml
+++ /dev/null
@@ -1,639 +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 the Solr schema file. This file should be named "schema.xml" and
- should be in the conf directory under the solr home
- (i.e. ./solr/conf/schema.xml by default)
- or located where the classloader for the Solr webapp can find it.
-
- This example schema is the recommended starting point for users.
- It should be kept correct and concise, usable out-of-the-box.
-
- For more information, on how to customize this file, please see
- http://wiki.apache.org/solr/SchemaXml
-
- PERFORMANCE NOTE: this schema includes many optional features and should not
- be used for benchmarking. To improve performance one could
- - set stored="false" for all fields possible (esp large fields) when you
- only need to search on the field but don't need to return the original
- value.
- - set indexed="false" if you don't need to search on the field, but only
- return the field as a result of searching on other indexed fields.
- - remove all unneeded copyField statements
- - for best index size and searching performance, set "index" to false
- for all general text fields, use copyField to copy them to the
- catchall "text" field, and use that for searching.
- - For maximum indexing performance, use the StreamingUpdateSolrServer
- java client.
- - Remember to run the JVM in server mode, and use a higher logging level
- that avoids logging every request
--->
-
-<schema name="example" version="1.4">
- <!-- attribute "name" is the name of this schema and is only used for display purposes.
- Applications should change this to reflect the nature of the search collection.
- version="1.4" is Solr's version number for the schema syntax and semantics. It should
- not normally be changed by applications.
- 1.0: multiValued attribute did not exist, all fields are multiValued by nature
- 1.1: multiValued attribute introduced, false by default
- 1.2: omitTermFreqAndPositions attribute introduced, true by default except for text fields.
- 1.3: removed optional field compress feature
- 1.4: default auto-phrase (QueryParser feature) to off
- -->
-
- <types>
- <!-- field type definitions. The "name" attribute is
- just a label to be used by field definitions. The "class"
- attribute and any other attributes determine the real
- behavior of the fieldType.
- Class names starting with "solr" refer to java classes in the
- org.apache.solr.analysis package.
- -->
-
- <!-- The StrField type is not analyzed, but indexed/stored verbatim. -->
- <fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/>
-
- <!-- boolean type: "true" or "false" -->
- <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true" omitNorms="true"/>
- <!--Binary data type. The data should be sent/retrieved in as Base64 encoded Strings -->
- <fieldtype name="binary" class="solr.BinaryField"/>
-
- <!-- The optional sortMissingLast and sortMissingFirst attributes are
- currently supported on types that are sorted internally as strings.
- This includes "string","boolean","sint","slong","sfloat","sdouble","pdate"
- - If sortMissingLast="true", then a sort on this field will cause documents
- without the field to come after documents with the field,
- regardless of the requested sort order (asc or desc).
- - If sortMissingFirst="true", then a sort on this field will cause documents
- without the field to come before documents with the field,
- regardless of the requested sort order.
- - If sortMissingLast="false" and sortMissingFirst="false" (the default),
- then default lucene sorting will be used which places docs without the
- field first in an ascending sort and last in a descending sort.
- -->
-
- <!--
- Default numeric field types. For faster range queries, consider the tint/tfloat/tlong/tdouble types.
- -->
- <fieldType name="int" class="solr.IntPointField" omitNorms="true" positionIncrementGap="0"/>
- <fieldType name="float" class="solr.FloatPointField" omitNorms="true" positionIncrementGap="0"/>
- <fieldType name="long" class="solr.LongPointField" omitNorms="true" positionIncrementGap="0"/>
- <fieldType name="double" class="solr.DoublePointField" omitNorms="true" positionIncrementGap="0"/>
-
- <!--
- Numeric field types that index each value at various levels of precision
- to accelerate range queries when the number of values between the range
- endpoints is large. See the javadoc for NumericRangeQuery for internal
- implementation details.
-
- Smaller precisionStep values (specified in bits) will lead to more tokens
- indexed per value, slightly larger index size, and faster range queries.
- A precisionStep of 0 disables indexing at different precision levels.
- -->
- <fieldType name="tint" class="solr.IntPointField" omitNorms="true" positionIncrementGap="0"/>
- <fieldType name="tfloat" class="solr.FloatPointField" omitNorms="true" positionIncrementGap="0"/>
- <fieldType name="tlong" class="solr.LongPointField" omitNorms="true" positionIncrementGap="0"/>
- <fieldType name="tdouble" class="solr.DoublePointField" omitNorms="true" positionIncrementGap="0"/>
-
- <!-- The format for this date field is of the form 1995-12-31T23:59:59Z, and
- is a more restricted form of the canonical representation of dateTime
- http://www.w3.org/TR/xmlschema-2/#dateTime
- The trailing "Z" designates UTC time and is mandatory.
- Optional fractional seconds are allowed: 1995-12-31T23:59:59.999Z
- All other components are mandatory.
-
- Expressions can also be used to denote calculations that should be
- performed relative to "NOW" to determine the value, ie...
-
- NOW/HOUR
- ... Round to the start of the current hour
- NOW-1DAY
- ... Exactly 1 day prior to now
- NOW/DAY+6MONTHS+3DAYS
- ... 6 months and 3 days in the future from the start of
- the current day
-
- Consult the DateField javadocs for more information.
-
- Note: For faster range queries, consider the tdate type
- -->
- <fieldType name="date" class="solr.DatePointField" omitNorms="true" positionIncrementGap="0"/>
-
- <!-- A Trie based date field for faster date range queries and date faceting. -->
- <fieldType name="tdate" class="solr.DatePointField" omitNorms="true" positionIncrementGap="0"/>
-
-
- <!--
- Note:
- These should only be used for compatibility with existing indexes (created with older Solr versions)
- or if "sortMissingFirst" or "sortMissingLast" functionality is needed. Use Trie based fields instead.
-
- Plain numeric field types that store and index the text
- value verbatim (and hence don't support range queries, since the
- lexicographic ordering isn't equal to the numeric ordering)
- -->
- <fieldType name="pint" class="solr.IntPointField" omitNorms="true"/>
- <fieldType name="plong" class="solr.LongPointField" omitNorms="true"/>
- <fieldType name="pfloat" class="solr.FloatPointField" omitNorms="true"/>
- <fieldType name="pdouble" class="solr.DoublePointField" omitNorms="true"/>
- <fieldType name="pdate" class="solr.DatePointField" sortMissingLast="true" omitNorms="true"/>
-
-
- <!--
- Note:
- These should only be used for compatibility with existing indexes (created with older Solr versions)
- or if "sortMissingFirst" or "sortMissingLast" functionality is needed. Use Trie based fields instead.
-
- Numeric field types that manipulate the value into
- a string value that isn't human-readable in its internal form,
- but with a lexicographic ordering the same as the numeric ordering,
- so that range queries work correctly.
- -->
- <fieldType name="sint" class="solr.IntPointField" sortMissingLast="true" omitNorms="true"/>
- <fieldType name="slong" class="solr.LongPointField" sortMissingLast="true" omitNorms="true"/>
- <fieldType name="sfloat" class="solr.FloatPointField" sortMissingLast="true" omitNorms="true"/>
- <fieldType name="sdouble" class="solr.DoublePointField" sortMissingLast="true" omitNorms="true"/>
-
-
- <!-- The "RandomSortField" is not used to store or search any
- data. You can declare fields of this type it in your schema
- to generate pseudo-random orderings of your docs for sorting
- purposes. The ordering is generated based on the field name
- and the version of the index, As long as the index version
- remains unchanged, and the same field name is reused,
- the ordering of the docs will be consistent.
- If you want different psuedo-random orderings of documents,
- for the same version of the index, use a dynamicField and
- change the name
- -->
- <fieldType name="random" class="solr.RandomSortField" indexed="true" />
-
- <!-- solr.TextField allows the specification of custom text analyzers
- specified as a tokenizer and a list of token filters. Different
- analyzers may be specified for indexing and querying.
-
- The optional positionIncrementGap puts space between multiple fields of
- this type on the same document, with the purpose of preventing false phrase
- matching across fields.
-
- For more info on customizing your analyzer chain, please see
- http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters
- -->
-
- <!-- One can also specify an existing Analyzer class that has a
- default constructor via the class attribute on the analyzer element
- <fieldType name="text_greek" class="solr.TextField">
- <analyzer class="org.apache.lucene.analysis.el.GreekAnalyzer"/>
- </fieldType>
- -->
-
- <!-- A text field that only splits on whitespace for exact matching of words -->
- <fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100">
- <analyzer>
- <tokenizer class="solr.WhitespaceTokenizerFactory"/>
- </analyzer>
- </fieldType>
-
- <!-- A general text field that has reasonable, generic
- cross-language defaults: it tokenizes with StandardTokenizer,
- removes stop words from case-insensitive "stopwords.txt"
- (empty by default), and down cases. At query time only, it
- also applies synonyms. -->
- <fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
- <analyzer type="index">
- <tokenizer class="solr.StandardTokenizerFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
- <!-- in this example, we will only use synonyms at query time
- <filter class="solr.FlattenGraphFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
- -->
- <filter class="solr.LowerCaseFilterFactory"/>
- </analyzer>
- <analyzer type="query">
- <tokenizer class="solr.StandardTokenizerFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
- <filter class="solr.SynonymGraphFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
- <filter class="solr.LowerCaseFilterFactory"/>
- </analyzer>
- </fieldType>
-
- <!-- A text field with defaults appropriate for English: it
- tokenizes with StandardTokenizer, removes English stop words
- (stopwords_en.txt), down cases, protects words from protwords.txt, and
- finally applies Porter's stemming. The query time analyzer
- also applies synonyms from synonyms.txt. -->
- <fieldType name="text_en" class="solr.TextField" positionIncrementGap="100">
- <analyzer type="index">
- <tokenizer class="solr.StandardTokenizerFactory"/>
- <!-- in this example, we will only use synonyms at query time
- <filter class="solr.FlattenGraphFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
- -->
- <!-- Case insensitive stop word removal.
- -->
- <filter class="solr.StopFilterFactory"
- ignoreCase="true"
- words="stopwords_en.txt"
- />
- <filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.EnglishPossessiveFilterFactory"/>
- <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
- <!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory:
- <filter class="solr.EnglishMinimalStemFilterFactory"/>
- -->
- <filter class="solr.PorterStemFilterFactory"/>
- </analyzer>
- <analyzer type="query">
- <tokenizer class="solr.StandardTokenizerFactory"/>
- <filter class="solr.SynonymGraphFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
- <filter class="solr.StopFilterFactory"
- ignoreCase="true"
- words="stopwords_en.txt"
- />
- <filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.EnglishPossessiveFilterFactory"/>
- <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
- <!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory:
- <filter class="solr.EnglishMinimalStemFilterFactory"/>
- -->
- <filter class="solr.PorterStemFilterFactory"/>
- </analyzer>
- </fieldType>
-
- <!-- A text field with defaults appropriate for English, plus
- aggressive word-splitting and autophrase features enabled.
- This field is just like text_en, except it adds
- WordDelimiterFilter to enable splitting and matching of
- words on case-change, alpha numeric boundaries, and
- non-alphanumeric chars. This means certain compound word
- cases will work, for example query "wi fi" will match
- document "WiFi" or "wi-fi". However, other cases will still
- not match, for example if the query is "wifi" and the
- document is "wi fi" or if the query is "wi-fi" and the
- document is "wifi".
- -->
- <fieldType name="text_en_splitting" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
- <analyzer type="index">
- <tokenizer class="solr.WhitespaceTokenizerFactory"/>
- <!-- in this example, we will only use synonyms at query time
- <filter class="solr.FlattenGraphFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
- -->
- <!-- Case insensitive stop word removal.
- -->
- <filter class="solr.StopFilterFactory"
- ignoreCase="true"
- words="stopwords_en.txt"
- />
- <filter class="solr.WordDelimiterGraphFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
- <filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
- <filter class="solr.PorterStemFilterFactory"/>
- </analyzer>
- <analyzer type="query">
- <tokenizer class="solr.WhitespaceTokenizerFactory"/>
- <filter class="solr.SynonymGraphFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
- <filter class="solr.StopFilterFactory"
- ignoreCase="true"
- words="stopwords_en.txt"
- />
- <filter class="solr.WordDelimiterGraphFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
- <filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
- <filter class="solr.PorterStemFilterFactory"/>
- </analyzer>
- </fieldType>
-
- <!-- Less flexible matching, but less false matches. Probably not ideal for product names,
- but may be good for SKUs. Can insert dashes in the wrong place and still match. -->
- <fieldType name="text_en_splitting_tight" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
- <analyzer>
- <tokenizer class="solr.WhitespaceTokenizerFactory"/>
- <filter class="solr.SynonymGraphFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="false"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords_en.txt"/>
- <filter class="solr.WordDelimiterGraphFilterFactory" generateWordParts="0" generateNumberParts="0" catenateWords="1" catenateNumbers="1" catenateAll="0"/>
- <filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
- <filter class="solr.EnglishMinimalStemFilterFactory"/>
- <!-- this filter can remove any duplicate tokens that appear at the same position - sometimes
- possible with WordDelimiterFilter in conjuncton with stemming. -->
- <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
- </analyzer>
- </fieldType>
-
- <!-- Just like text_general except it reverses the characters of
- each token, to enable more efficient leading wildcard queries. -->
- <fieldType name="text_general_rev" class="solr.TextField" positionIncrementGap="100">
- <analyzer type="index">
- <tokenizer class="solr.StandardTokenizerFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
- <filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.ReversedWildcardFilterFactory" withOriginal="true"
- maxPosAsterisk="3" maxPosQuestion="2" maxFractionAsterisk="0.33"/>
- </analyzer>
- <analyzer type="query">
- <tokenizer class="solr.StandardTokenizerFactory"/>
- <filter class="solr.SynonymGraphFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
- <filter class="solr.LowerCaseFilterFactory"/>
- </analyzer>
- </fieldType>
-
- <!-- charFilter + WhitespaceTokenizer -->
- <!--
- <fieldType name="text_char_norm" class="solr.TextField" positionIncrementGap="100" >
- <analyzer>
- <charFilter class="solr.MappingCharFilterFactory" mapping="mapping-ISOLatin1Accent.txt"/>
- <tokenizer class="solr.WhitespaceTokenizerFactory"/>
- </analyzer>
- </fieldType>
- -->
-
- <!-- This is an example of using the KeywordTokenizer along
- With various TokenFilterFactories to produce a sortable field
- that does not include some properties of the source text
- -->
- <fieldType name="alphaOnlySort" class="solr.TextField" sortMissingLast="true" omitNorms="true">
- <analyzer>
- <!-- KeywordTokenizer does no actual tokenizing, so the entire
- input string is preserved as a single token
- -->
- <tokenizer class="solr.KeywordTokenizerFactory"/>
- <!-- The LowerCase TokenFilter does what you expect, which can be
- when you want your sorting to be case insensitive
- -->
- <filter class="solr.LowerCaseFilterFactory" />
- <!-- The TrimFilter removes any leading or trailing whitespace -->
- <filter class="solr.TrimFilterFactory" />
- <!-- The PatternReplaceFilter gives you the flexibility to use
- Java Regular expression to replace any sequence of characters
- matching a pattern with an arbitrary replacement string,
- which may include back references to portions of the original
- string matched by the pattern.
-
- See the Java Regular Expression documentation for more
- information on pattern and replacement string syntax.
-
- http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/package-summary.html
- -->
- <filter class="solr.PatternReplaceFilterFactory"
- pattern="([^a-z])" replacement="" replace="all"
- />
- </analyzer>
- </fieldType>
-
- <fieldtype name="phonetic" stored="false" indexed="true" class="solr.TextField" >
- <analyzer>
- <tokenizer class="solr.StandardTokenizerFactory"/>
- <filter class="solr.DoubleMetaphoneFilterFactory" inject="false"/>
- </analyzer>
- </fieldtype>
-
- <fieldtype name="payloads" stored="false" indexed="true" class="solr.TextField" >
- <analyzer>
- <tokenizer class="solr.WhitespaceTokenizerFactory"/>
- <!--
- The DelimitedPayloadTokenFilter can put payloads on tokens... for example,
- a token of "foo|1.4" would be indexed as "foo" with a payload of 1.4f
- Attributes of the DelimitedPayloadTokenFilterFactory :
- "delimiter" - a one character delimiter. Default is | (pipe)
- "encoder" - how to encode the following value into a playload
- float -> org.apache.lucene.analysis.payloads.FloatEncoder,
- integer -> o.a.l.a.p.IntegerEncoder
- identity -> o.a.l.a.p.IdentityEncoder
- Fully Qualified class name implementing PayloadEncoder, Encoder must have a no arg constructor.
- -->
- <filter class="solr.DelimitedPayloadTokenFilterFactory" encoder="float"/>
- </analyzer>
- </fieldtype>
-
- <!-- lowercases the entire field value, keeping it as a single token. -->
- <fieldType name="lowercase" class="solr.TextField" positionIncrementGap="100">
- <analyzer>
- <tokenizer class="solr.KeywordTokenizerFactory"/>
- <filter class="solr.LowerCaseFilterFactory" />
- </analyzer>
- </fieldType>
-
- <fieldType name="text_path" class="solr.TextField" positionIncrementGap="100">
- <analyzer>
- <tokenizer class="solr.PathHierarchyTokenizerFactory"/>
- </analyzer>
- </fieldType>
-
- <!-- since fields of this type are by default not stored or indexed,
- any data added to them will be ignored outright. -->
- <fieldtype name="ignored" stored="false" indexed="false" multiValued="true" class="solr.StrField" />
-
- <!-- This point type indexes the coordinates as separate fields (subFields)
- If subFieldType is defined, it references a type, and a dynamic field
- definition is created matching *___<typename>. Alternately, if
- subFieldSuffix is defined, that is used to create the subFields.
- Example: if subFieldType="double", then the coordinates would be
- indexed in fields myloc_0___double,myloc_1___double.
- Example: if subFieldSuffix="_d" then the coordinates would be indexed
- in fields myloc_0_d,myloc_1_d
- The subFields are an implementation detail of the fieldType, and end
- users normally should not need to know about them.
- -->
- <fieldType name="point" class="solr.PointType" dimension="2" subFieldSuffix="_d"/>
-
- <!-- A specialized field for geospatial search. If indexed, this fieldType must not be multivalued. -->
- <fieldType name="location" class="solr.LatLonPointSpatialField"/>
-
- <!--
- A Geohash is a compact representation of a latitude longitude pair in a single field.
- See http://wiki.apache.org/solr/SpatialSearch
- -->
- <fieldtype name="geohash" class="solr.LatLonPointSpatialField"/>
- </types>
-
-
- <fields>
- <!-- Valid attributes for fields:
- name: mandatory - the name for the field
- type: mandatory - the name of a previously defined type from the
- <types> section
- indexed: true if this field should be indexed (searchable or sortable)
- stored: true if this field should be retrievable
- multiValued: true if this field may contain multiple values per document
- omitNorms: (expert) set to true to omit the norms associated with
- this field (this disables length normalization and index-time
- boosting for the field, and saves some memory). Only full-text
- fields or fields that need an index-time boost need norms.
- termVectors: [false] set to true to store the term vector for a
- given field.
- When using MoreLikeThis, fields used for similarity should be
- stored for best performance.
- termPositions: Store position information with the term vector.
- This will increase storage costs.
- termOffsets: Store offset information with the term vector. This
- will increase storage costs.
- default: a value that should be used if no value is specified
- when adding a document.
- -->
-
- <field name="id" type="string" indexed="true" stored="true" required="true" />
- <field name="sku" type="text_en_splitting_tight" indexed="true" stored="true" omitNorms="true"/>
- <field name="name" type="text_general" indexed="true" stored="true"/>
- <field name="alphaNameSort" type="alphaOnlySort" indexed="true" stored="false"/>
- <field name="manu" type="text_general" indexed="true" stored="true" omitNorms="true"/>
- <field name="cat" type="string" indexed="true" stored="true" multiValued="true"/>
- <field name="features" type="text_general" indexed="true" stored="true" multiValued="true"/>
- <field name="includes" type="text_general" indexed="true" stored="true" termVectors="true" termPositions="true" termOffsets="true" />
-
- <field name="weight" type="float" indexed="true" stored="true"/>
- <field name="price" type="float" indexed="true" stored="true"/>
- <field name="popularity" type="int" indexed="true" stored="true" />
- <field name="inStock" type="boolean" indexed="true" stored="true" />
-
- <!--
- The following store examples are used to demonstrate the various ways one might _CHOOSE_ to
- implement spatial. It is highly unlikely that you would ever have ALL of these fields defined.
- -->
- <field name="store" type="location" indexed="true" stored="true"/>
-
- <!-- Common metadata fields, named specifically to match up with
- SolrCell metadata when parsing rich documents such as Word, PDF.
- Some fields are multiValued only because Tika currently may return
- multiple values for them.
- -->
- <field name="title" type="text_general" indexed="true" stored="true" multiValued="true"/>
- <field name="subject" type="text_general" indexed="true" stored="true"/>
- <field name="description" type="text_general" indexed="true" stored="true"/>
- <field name="comments" type="text_general" indexed="true" stored="true"/>
- <field name="author" type="text_general" indexed="true" stored="true"/>
- <field name="keywords" type="text_general" indexed="true" stored="true"/>
- <field name="category" type="text_general" indexed="true" stored="true"/>
- <field name="content_type" type="string" indexed="true" stored="true" multiValued="true"/>
- <field name="last_modified" type="date" indexed="true" stored="true"/>
- <field name="links" type="string" indexed="true" stored="true" multiValued="true"/>
-
- <!-- req for solrcloud -->
- <field name="_version_" type="long" indexed="true" stored="true"/>
-
-
-
- <!-- catchall field, containing all other searchable text fields (implemented
- via copyField further on in this schema -->
- <field name="text" type="text_general" indexed="true" stored="false" multiValued="true"/>
-
- <!-- catchall text field that indexes tokens both normally and in reverse for efficient
- leading wildcard queries. -->
- <field name="text_rev" type="text_general_rev" indexed="true" stored="false" multiValued="true"/>
-
- <!-- non-tokenized version of manufacturer to make it easier to sort or group
- results by manufacturer. copied from "manu" via copyField -->
- <field name="manu_exact" type="string" indexed="true" stored="false"/>
-
- <field name="payloads" type="payloads" indexed="true" stored="true"/>
-
- <!-- Uncommenting the following will create a "timestamp" field using
- a default value of "NOW" to indicate when each document was indexed.
- -->
- <!--
- <field name="timestamp" type="date" indexed="true" stored="true" default="NOW" multiValued="false"/>
- -->
-
-
- <!-- Dynamic field definitions. If a field name is not found, dynamicFields
- will be used if the name matches any of the patterns.
- RESTRICTION: the glob-like pattern in the name attribute must have
- a "*" only at the start or the end.
- EXAMPLE: name="*_i" will match any field ending in _i (like myid_i, z_i)
- Longer patterns will be matched first. if equal size patterns
- both match, the first appearing in the schema will be used. -->
- <dynamicField name="*_i" type="int" indexed="true" stored="true"/>
- <dynamicField name="*_s" type="string" indexed="true" stored="true"/>
- <dynamicField name="*_l" type="long" indexed="true" stored="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="*_f" type="float" indexed="true" stored="true"/>
- <dynamicField name="*_d" type="double" indexed="true" stored="true"/>
-
- <!-- Type used to index the lat and lon components for the "location" FieldType -->
- <dynamicField name="*_coordinate" type="tdouble" indexed="true" stored="false"/>
-
- <dynamicField name="*_dt" type="date" indexed="true" stored="true"/>
- <dynamicField name="*_p" type="location" indexed="true" stored="true"/>
-
- <!-- some trie-coded dynamic fields for faster range queries -->
- <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="ignored_*" type="ignored" multiValued="true"/>
- <dynamicField name="attr_*" type="text_general" indexed="true" stored="true" multiValued="true"/>
-
- <dynamicField name="random_*" type="random" />
-
- <!-- uncomment the following to ignore any fields that don't already match an existing
- field name or dynamic field, rather than reporting them as an error.
- alternately, change the type="ignored" to some other type e.g. "text" if you want
- unknown fields indexed and/or stored by default -->
- <!--dynamicField name="*" type="ignored" multiValued="true" /-->
-
- </fields>
-
- <!-- Field to use to determine and enforce document uniqueness.
- Unless this field is marked with required="false", it will be a required field
- -->
- <uniqueKey>id</uniqueKey>
-
- <!-- copyField commands copy one field to another at the time a document
- is added to the index. It's used either to index the same field differently,
- or to add multiple fields to the same field for easier/faster searching. -->
-
- <copyField source="cat" dest="text"/>
- <copyField source="name" dest="text"/>
- <copyField source="manu" dest="text"/>
- <copyField source="features" dest="text"/>
- <copyField source="includes" dest="text"/>
- <copyField source="manu" dest="manu_exact"/>
-
- <!-- Above, multiple source fields are copied to the [text] field.
- Another way to map multiple source fields to the same
- destination field is to use the dynamic field syntax.
- copyField also supports a maxChars to copy setting. -->
-
- <!-- <copyField source="*_t" dest="text" maxChars="3000"/> -->
-
- <!-- copy name to alphaNameSort, a field designed for sorting by name -->
- <!-- <copyField source="name" dest="alphaNameSort"/> -->
-
-
- <!-- Similarity is the scoring routine for each document vs. a query.
- A custom similarity may be specified here, but the default is fine
- for most applications. -->
- <!-- <similarity class="org.apache.lucene.search.DefaultSimilarity"/> -->
- <!-- ... OR ...
- Specify a SimilarityFactory class name implementation
- allowing parameters to be used.
- -->
- <!--
- <similarity class="com.example.solr.CustomSimilarityFactory">
- <str name="paramkey">param value</str>
- </similarity>
- -->
-
-
-</schema>
diff --git a/components/camel-solr/src/test/resources/solr/collection1/conf/scripts.conf b/components/camel-solr/src/test/resources/solr/collection1/conf/scripts.conf
deleted file mode 100644
index f58b262ae0c..00000000000
--- a/components/camel-solr/src/test/resources/solr/collection1/conf/scripts.conf
+++ /dev/null
@@ -1,24 +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.
-
-user=
-solr_hostname=localhost
-solr_port=8983
-rsyncd_port=18983
-data_dir=
-webapp_name=solr
-master_host=
-master_data_dir=
-master_status_dir=
diff --git a/components/camel-solr/src/test/resources/solr/collection1/conf/solrconfig.xml b/components/camel-solr/src/test/resources/solr/collection1/conf/solrconfig.xml
deleted file mode 100644
index 68f8d80a29f..00000000000
--- a/components/camel-solr/src/test/resources/solr/collection1/conf/solrconfig.xml
+++ /dev/null
@@ -1,1818 +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>
- <!-- In all configuration below, a prefix of "solr." for class names
- is an alias that causes solr to search appropriate packages,
- including org.apache.solr.(search|update|request|core|analysis)
-
- You may also specify a fully qualified Java classname if you
- have your own custom plugins.
- -->
-
- <!-- Controls what version of Lucene various components of Solr
- adhere to. Generally, you want to use the latest version to
- get all bug fixes and improvements. It is highly recommended
- that you fully re-index after changing this setting as it can
- affect both how text is indexed and queried.
- -->
- <luceneMatchVersion>7.2.1</luceneMatchVersion>
-
- <!-- an exact 'path' can be used instead of a 'dir' to specify a
- specific jar file. This will cause a serious error to be logged
- if it can't be loaded.
- -->
- <!--
- <lib path="../a-jar-that-does-not-exist.jar" />
- -->
-
- <!-- Data Directory
-
- Used to specify an alternate directory to hold all index data
- other than the default ./data under the Solr home. If
- replication is in use, this should match the replication
- configuration.
- -->
- <dataDir>${solr.data.dir:}</dataDir>
-
-
- <!-- The DirectoryFactory to use for indexes.
-
- solr.StandardDirectoryFactory is filesystem
- based and tries to pick the best implementation for the current
- JVM and platform. solr.NRTCachingDirectoryFactory, the default,
- wraps solr.StandardDirectoryFactory and caches small files in memory
- for better NRT performance.
-
- One can force a particular implementation via solr.MMapDirectoryFactory,
- solr.NIOFSDirectoryFactory, or solr.SimpleFSDirectoryFactory.
-
- solr.RAMDirectoryFactory is memory based, not
- persistent, and doesn't work with replication.
- -->
- <directoryFactory name="DirectoryFactory"
- class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}">
-
-
- <!-- These will be used if you are using the solr.HdfsDirectoryFactory,
- otherwise they will be ignored. If you don't plan on using hdfs,
- you can safely remove this section. -->
- <!-- The root directory that collection data should be written to. -->
- <str name="solr.hdfs.home">${solr.hdfs.home:}</str>
- <!-- The hadoop configuration files to use for the hdfs client. -->
- <str name="solr.hdfs.confdir">${solr.hdfs.confdir:}</str>
- <!-- Enable/Disable the hdfs cache. -->
- <str name="solr.hdfs.blockcache.enabled">${solr.hdfs.blockcache.enabled:true}</str>
- <!-- Enable/Disable using one global cache for all SolrCores.
- The settings used will be from the first HdfsDirectoryFactory created. -->
- <str name="solr.hdfs.blockcache.global">${solr.hdfs.blockcache.global:true}</str>
-
- </directoryFactory>
-
- <!-- The CodecFactory for defining the format of the inverted index.
- The default implementation is SchemaCodecFactory, which is the official Lucene
- index format, but hooks into the schema to provide per-field customization of
- the postings lists and per-document values in the fieldType element
- (postingsFormat/docValuesFormat). Note that most of the alternative implementations
- are experimental, so if you choose to customize the index format, its a good
- idea to convert back to the official format e.g. via IndexWriter.addIndexes(IndexReader)
- before upgrading to a newer version to avoid unnecessary reindexing.
- -->
- <codecFactory class="solr.SchemaCodecFactory"/>
-
- <!-- To enable dynamic schema REST APIs, use the following for <schemaFactory>:
-
- <schemaFactory class="ManagedIndexSchemaFactory">
- <bool name="mutable">true</bool>
- <str name="managedSchemaResourceName">managed-schema</str>
- </schemaFactory>
-
- When ManagedIndexSchemaFactory is specified, Solr will load the schema from
- he resource named in 'managedSchemaResourceName', rather than from schema.xml.
- Note that the managed schema resource CANNOT be named schema.xml. If the managed
- schema does not exist, Solr will create it after reading schema.xml, then rename
- 'schema.xml' to 'schema.xml.bak'.
-
- Do NOT hand edit the managed schema - external modifications will be ignored and
- overwritten as a result of schema modification REST API calls.
-
- When ManagedIndexSchemaFactory is specified with mutable = true, schema
- modification REST API calls will be allowed; otherwise, error responses will be
- sent back for these requests.
- -->
- <schemaFactory class="ClassicIndexSchemaFactory"/>
-
- <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Index Config - These settings control low-level behavior of indexing
- Most example settings here show the default value, but are commented
- out, to more easily see where customizations have been made.
-
- Note: This replaces <indexDefaults> and <mainIndex> from older versions
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <indexConfig>
- <!-- maxFieldLength was removed in 4.0. To get similar behavior, include a
- LimitTokenCountFilterFactory in your fieldType definition. E.g.
- <filter class="solr.LimitTokenCountFilterFactory" maxTokenCount="10000"/>
- -->
- <!-- Maximum time to wait for a write lock (ms) for an IndexWriter. Default: 1000 -->
- <!-- <writeLockTimeout>1000</writeLockTimeout> -->
-
- <!-- The maximum number of simultaneous threads that may be
- indexing documents at once in IndexWriter; if more than this
- many threads arrive they will wait for others to finish.
- Default in Solr/Lucene is 8. -->
- <!-- <maxIndexingThreads>8</maxIndexingThreads> -->
-
- <!-- Expert: Enabling compound file will use less files for the index,
- using fewer file descriptors on the expense of performance decrease.
- Default in Lucene is "true". Default in Solr is "false" (since 3.6) -->
- <!-- <useCompoundFile>false</useCompoundFile> -->
-
- <!-- ramBufferSizeMB sets the amount of RAM that may be used by Lucene
- indexing for buffering added documents and deletions before they are
- flushed to the Directory.
- maxBufferedDocs sets a limit on the number of documents buffered
- before flushing.
- If both ramBufferSizeMB and maxBufferedDocs is set, then
- Lucene will flush based on whichever limit is hit first.
- The default is 100 MB. -->
- <!-- <ramBufferSizeMB>100</ramBufferSizeMB> -->
- <!-- <maxBufferedDocs>1000</maxBufferedDocs> -->
-
- <!-- Expert: Merge Policy
- The Merge Policy in Lucene controls how merging of segments is done.
- The default since Solr/Lucene 3.3 is TieredMergePolicy.
- The default since Lucene 2.3 was the LogByteSizeMergePolicy,
- Even older versions of Lucene used LogDocMergePolicy.
- -->
- <!--
- <mergePolicy class="org.apache.lucene.index.TieredMergePolicy">
- <int name="maxMergeAtOnce">10</int>
- <int name="segmentsPerTier">10</int>
- </mergePolicy>
- -->
-
- <!-- Merge Factor
- The merge factor controls how many segments will get merged at a time.
- For TieredMergePolicy, mergeFactor is a convenience parameter which
- will set both MaxMergeAtOnce and SegmentsPerTier at once.
- For LogByteSizeMergePolicy, mergeFactor decides how many new segments
- will be allowed before they are merged into one.
- Default is 10 for both merge policies.
- -->
- <!--
- <mergeFactor>10</mergeFactor>
- -->
-
- <!-- Expert: Merge Scheduler
- The Merge Scheduler in Lucene controls how merges are
- performed. The ConcurrentMergeScheduler (Lucene 2.3 default)
- can perform merges in the background using separate threads.
- The SerialMergeScheduler (Lucene 2.2 default) does not.
- -->
- <!--
- <mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/>
- -->
-
- <!-- LockFactory
-
- This option specifies which Lucene LockFactory implementation
- to use.
-
- single = SingleInstanceLockFactory - suggested for a
- read-only index or when there is no possibility of
- another process trying to modify the index.
- native = NativeFSLockFactory - uses OS native file locking.
- Do not use when multiple solr webapps in the same
- JVM are attempting to share a single index.
- simple = SimpleFSLockFactory - uses a plain file for locking
-
- Defaults: 'native' is default for Solr3.6 and later, otherwise
- 'simple' is the default
-
- More details on the nuances of each LockFactory...
- http://wiki.apache.org/lucene-java/AvailableLockFactories
- -->
- <lockType>${solr.lock.type:single}</lockType>
-
- <!-- Unlock On Startup
-
- If true, unlock any held write or commit locks on startup.
- This defeats the locking mechanism that allows multiple
- processes to safely access a lucene index, and should be used
- with care. Default is "false".
-
- This is not needed if lock type is 'single'
- -->
- <!--
- <unlockOnStartup>false</unlockOnStartup>
- -->
-
- <!-- Expert: Controls how often Lucene loads terms into memory
- Default is 128 and is likely good for most everyone.
- -->
- <!-- <termIndexInterval>128</termIndexInterval> -->
-
- <!-- If true, IndexReaders will be opened/reopened from the IndexWriter
- instead of from the Directory. Hosts in a master/slave setup
- should have this set to false while those in a SolrCloud
- cluster need to be set to true. Default: true
- -->
- <!--
- <nrtMode>true</nrtMode>
- -->
-
- <!-- Commit Deletion Policy
- Custom deletion policies can be specified here. The class must
- implement org.apache.lucene.index.IndexDeletionPolicy.
-
- The default Solr IndexDeletionPolicy implementation supports
- deleting index commit points on number of commits, age of
- commit point and optimized status.
-
- The latest commit point should always be preserved regardless
- of the criteria.
- -->
- <!--
- <deletionPolicy class="solr.SolrDeletionPolicy">
- -->
- <!-- The number of commit points to be kept -->
- <!-- <str name="maxCommitsToKeep">1</str> -->
- <!-- The number of optimized commit points to be kept -->
- <!-- <str name="maxOptimizedCommitsToKeep">0</str> -->
- <!--
- Delete all commit points once they have reached the given age.
- Supports DateMathParser syntax e.g.
- -->
- <!--
- <str name="maxCommitAge">30MINUTES</str>
- <str name="maxCommitAge">1DAY</str>
- -->
- <!--
- </deletionPolicy>
- -->
-
- <!-- Lucene Infostream
-
- To aid in advanced debugging, Lucene provides an "InfoStream"
- of detailed information when indexing.
-
- Setting the value to true will instruct the underlying Lucene
- IndexWriter to write its info stream to solr's log. By default,
- this is enabled here, and controlled through log4j.properties.
- -->
- <infoStream>true</infoStream>
- </indexConfig>
-
-
- <!-- JMX
-
- This example enables JMX if and only if an existing MBeanServer
- is found, use this if you want to configure JMX through JVM
- parameters. Remove this to disable exposing Solr configuration
- and statistics to JMX.
-
- For more details see http://wiki.apache.org/solr/SolrJmx
- -->
- <jmx />
- <!-- If you want to connect to a particular server, specify the
- agentId
- -->
- <!-- <jmx agentId="myAgent" /> -->
- <!-- If you want to start a new MBeanServer, specify the serviceUrl -->
- <!-- <jmx serviceUrl="service:jmx:rmi:///jndi/rmi://localhost:9999/solr"/>
- -->
-
- <!-- The default high-performance update handler -->
- <updateHandler class="solr.DirectUpdateHandler2">
-
- <!-- Enables a transaction log, used for real-time get, durability, and
- and solr cloud replica recovery. The log can grow as big as
- uncommitted changes to the index, so use of a hard autoCommit
- is recommended (see below).
- "dir" - the target directory for transaction logs, defaults to the
- solr data directory. -->
- <updateLog>
- <str name="dir">${solr.ulog.dir:}</str>
- </updateLog>
-
- <!-- AutoCommit
-
- Perform a hard commit automatically under certain conditions.
- Instead of enabling autoCommit, consider using "commitWithin"
- when adding documents.
-
- http://wiki.apache.org/solr/UpdateXmlMessages
-
- maxDocs - Maximum number of documents to add since the last
- commit before automatically triggering a new commit.
-
- maxTime - Maximum amount of time in ms that is allowed to pass
- since a document was added before automatically
- triggering a new commit.
- openSearcher - if false, the commit causes recent index changes
- to be flushed to stable storage, but does not cause a new
- searcher to be opened to make those changes visible.
-
- If the updateLog is enabled, then it's highly recommended to
- have some sort of hard autoCommit to limit the log size.
- -->
- <autoCommit>
- <maxTime>${solr.autoCommit.maxTime:15000}</maxTime>
- <openSearcher>false</openSearcher>
- </autoCommit>
-
- <!-- softAutoCommit is like autoCommit except it causes a
- 'soft' commit which only ensures that changes are visible
- but does not ensure that data is synced to disk. This is
- faster and more near-realtime friendly than a hard commit.
- -->
-
- <autoSoftCommit>
- <maxTime>${solr.autoSoftCommit.maxTime:-1}</maxTime>
- </autoSoftCommit>
-
- <!-- Update Related Event Listeners
-
- Various IndexWriter related events can trigger Listeners to
- take actions.
-
- postCommit - fired after every commit or optimize command
- postOptimize - fired after every optimize command
- -->
- <!-- The RunExecutableListener executes an external command from a
- hook such as postCommit or postOptimize.
-
- exe - the name of the executable to run
- dir - dir to use as the current working directory. (default=".")
- wait - the calling thread waits until the executable returns.
- (default="true")
- args - the arguments to pass to the program. (default is none)
- env - environment variables to set. (default is none)
- -->
- <!-- This example shows how RunExecutableListener could be used
- with the script based replication...
- http://wiki.apache.org/solr/CollectionDistribution
- -->
- <!--
- <listener event="postCommit" class="solr.RunExecutableListener">
- <str name="exe">solr/bin/snapshooter</str>
- <str name="dir">.</str>
- <bool name="wait">true</bool>
- <arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
- <arr name="env"> <str>MYVAR=val1</str> </arr>
- </listener>
- -->
-
- </updateHandler>
-
- <!-- IndexReaderFactory
-
- Use the following format to specify a custom IndexReaderFactory,
- which allows for alternate IndexReader implementations.
-
- ** Experimental Feature **
-
- Please note - Using a custom IndexReaderFactory may prevent
- certain other features from working. The API to
- IndexReaderFactory may change without warning or may even be
- removed from future releases if the problems cannot be
- resolved.
-
-
- ** Features that may not work with custom IndexReaderFactory **
-
- The ReplicationHandler assumes a disk-resident index. Using a
- custom IndexReader implementation may cause incompatibility
- with ReplicationHandler and may cause replication to not work
- correctly. See SOLR-1366 for details.
-
- -->
- <!--
- <indexReaderFactory name="IndexReaderFactory" class="package.class">
- <str name="someArg">Some Value</str>
- </indexReaderFactory >
- -->
- <!-- By explicitly declaring the Factory, the termIndexDivisor can
- be specified.
- -->
- <!--
- <indexReaderFactory name="IndexReaderFactory"
- class="solr.StandardIndexReaderFactory">
- <int name="setTermIndexDivisor">12</int>
- </indexReaderFactory >
- -->
-
- <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Query section - these settings control query time things like caches
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <query>
- <!-- Max Boolean Clauses
-
- Maximum number of clauses in each BooleanQuery, an exception
- is thrown if exceeded.
-
- ** WARNING **
-
- This option actually modifies a global Lucene property that
- will affect all SolrCores. If multiple solrconfig.xml files
- disagree on this property, the value at any given moment will
- be based on the last SolrCore to be initialized.
-
- -->
- <maxBooleanClauses>1024</maxBooleanClauses>
-
-
- <!-- Solr Internal Query Caches
-
- There are two implementations of cache available for Solr,
- LRUCache, based on a synchronized LinkedHashMap, and
- FastLRUCache, based on a ConcurrentHashMap.
-
- FastLRUCache has faster gets and slower puts in single
- threaded operation and thus is generally faster than LRUCache
- when the hit ratio of the cache is high (> 75%), and may be
- faster under other scenarios on multi-cpu systems.
- -->
-
- <!-- Filter Cache
-
- Cache used by SolrIndexSearcher for filters (DocSets),
- unordered sets of *all* documents that match a query. When a
- new searcher is opened, its caches may be prepopulated or
- "autowarmed" using data from caches in the old searcher.
- autowarmCount is the number of items to prepopulate. For
- LRUCache, the autowarmed items will be the most recently
- accessed items.
-
- Parameters:
- class - the SolrCache implementation LRUCache or
- (LRUCache or FastLRUCache)
- size - the maximum number of entries in the cache
- initialSize - the initial capacity (number of entries) of
- the cache. (see java.util.HashMap)
- autowarmCount - the number of entries to prepopulate from
- and old cache.
- -->
- <filterCache class="solr.FastLRUCache"
- size="512"
- initialSize="512"
- autowarmCount="0"/>
-
- <!-- Query Result Cache
-
- Caches results of searches - ordered lists of document ids
- (DocList) based on a query, a sort, and the range of documents requested.
- -->
- <queryResultCache class="solr.LRUCache"
- size="512"
- initialSize="512"
- autowarmCount="0"/>
-
- <!-- Document Cache
-
- Caches Lucene Document objects (the stored fields for each
- document). Since Lucene internal document ids are transient,
- this cache will not be autowarmed.
- -->
- <documentCache class="solr.LRUCache"
- size="512"
- initialSize="512"
- autowarmCount="0"/>
-
- <!-- custom cache currently used by block join -->
- <cache name="perSegFilter"
- class="solr.search.LRUCache"
- size="10"
- initialSize="0"
- autowarmCount="10"
- regenerator="solr.NoOpRegenerator" />
-
- <!-- Field Value Cache
-
- Cache used to hold field values that are quickly accessible
- by document id. The fieldValueCache is created by default
- even if not configured here.
- -->
- <!--
- <fieldValueCache class="solr.FastLRUCache"
- size="512"
- autowarmCount="128"
- showItems="32" />
- -->
-
- <!-- Custom Cache
-
- Example of a generic cache. These caches may be accessed by
- name through SolrIndexSearcher.getCache(),cacheLookup(), and
- cacheInsert(). The purpose is to enable easy caching of
- user/application level data. The regenerator argument should
- be specified as an implementation of solr.CacheRegenerator
- if autowarming is desired.
- -->
- <!--
- <cache name="myUserCache"
- class="solr.LRUCache"
- size="4096"
- initialSize="1024"
- autowarmCount="1024"
- regenerator="com.mycompany.MyRegenerator"
- />
- -->
-
-
- <!-- Lazy Field Loading
-
- If true, stored fields that are not requested will be loaded
- lazily. This can result in a significant speed improvement
- if the usual case is to not load all stored fields,
- especially if the skipped fields are large compressed text
- fields.
- -->
- <enableLazyFieldLoading>true</enableLazyFieldLoading>
-
- <!-- Use Filter For Sorted Query
-
- A possible optimization that attempts to use a filter to
- satisfy a search. If the requested sort does not include
- score, then the filterCache will be checked for a filter
- matching the query. If found, the filter will be used as the
- source of document ids, and then the sort will be applied to
- that.
-
- For most situations, this will not be useful unless you
- frequently get the same search repeatedly with different sort
- options, and none of them ever use "score"
- -->
- <!--
- <useFilterForSortedQuery>true</useFilterForSortedQuery>
- -->
-
- <!-- Result Window Size
-
- An optimization for use with the queryResultCache. When a search
- is requested, a superset of the requested number of document ids
- are collected. For example, if a search for a particular query
- requests matching documents 10 through 19, and queryWindowSize is 50,
- then documents 0 through 49 will be collected and cached. Any further
- requests in that range can be satisfied via the cache.
- -->
- <queryResultWindowSize>20</queryResultWindowSize>
-
- <!-- Maximum number of documents to cache for any entry in the
- queryResultCache.
- -->
- <queryResultMaxDocsCached>200</queryResultMaxDocsCached>
-
- <!-- Query Related Event Listeners
-
- Various IndexSearcher related events can trigger Listeners to
- take actions.
-
- newSearcher - fired whenever a new searcher is being prepared
- and there is a current searcher handling requests (aka
- registered). It can be used to prime certain caches to
- prevent long request times for certain requests.
-
- firstSearcher - fired whenever a new searcher is being
- prepared but there is no current registered searcher to handle
- requests or to gain autowarming data from.
-
-
- -->
- <!-- QuerySenderListener takes an array of NamedList and executes a
- local query request for each NamedList in sequence.
- -->
- <listener event="newSearcher" class="solr.QuerySenderListener">
- <arr name="queries">
- <!--
- <lst><str name="q">solr</str><str name="sort">price asc</str></lst>
- <lst><str name="q">rocks</str><str name="sort">weight asc</str></lst>
- -->
- </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>
-
- <!-- Use Cold Searcher
-
- If a search request comes in and there is no current
- registered searcher, then immediately register the still
- warming searcher and use it. If "false" then all requests
- will block until the first searcher is done warming.
- -->
- <useColdSearcher>false</useColdSearcher>
-
- <!-- Max Warming Searchers
-
- Maximum number of searchers that may be warming in the
- background concurrently. An error is returned if this limit
- is exceeded.
-
- Recommend values of 1-2 for read-only slaves, higher for
- masters w/o cache warming.
- -->
- <maxWarmingSearchers>2</maxWarmingSearchers>
-
- </query>
-
-
- <!-- Request Dispatcher
-
- This section contains instructions for how the SolrDispatchFilter
- should behave when processing requests for this SolrCore.
-
- handleSelect is a legacy option that affects the behavior of requests
- such as /select?qt=XXX
-
- handleSelect="true" will cause the SolrDispatchFilter to process
- the request and dispatch the query to a handler specified by the
- "qt" param, assuming "/select" isn't already registered.
-
- handleSelect="false" will cause the SolrDispatchFilter to
- ignore "/select" requests, resulting in a 404 unless a handler
- is explicitly registered with the name "/select"
-
- handleSelect="true" is not recommended for new users, but is the default
- for backwards compatibility
- -->
- <requestDispatcher handleSelect="false" >
- <!-- Request Parsing
-
- These settings indicate how Solr Requests may be parsed, and
- what restrictions may be placed on the ContentStreams from
- those requests
-
- enableRemoteStreaming - enables use of the stream.file
- and stream.url parameters for specifying remote streams.
-
- multipartUploadLimitInKB - specifies the max size (in KiB) of
- Multipart File Uploads that Solr will allow in a Request.
-
- formdataUploadLimitInKB - specifies the max size (in KiB) of
- form data (application/x-www-form-urlencoded) sent via
- POST. You can use POST to pass request parameters not
- fitting into the URL.
-
- addHttpRequestToContext - if set to true, it will instruct
- the requestParsers to include the original HttpServletRequest
- object in the context map of the SolrQueryRequest under the
- key "httpRequest". It will not be used by any of the existing
- Solr components, but may be useful when developing custom
- plugins.
-
- *** WARNING ***
- The settings below authorize Solr to fetch remote files, You
- should make sure your system has some authentication before
- using enableRemoteStreaming="true"
-
- -->
- <requestParsers enableRemoteStreaming="true"
- multipartUploadLimitInKB="2048000"
- formdataUploadLimitInKB="2048"
- addHttpRequestToContext="false"/>
-
- <!-- HTTP Caching
-
- Set HTTP caching related parameters (for proxy caches and clients).
-
- The options below instruct Solr not to output any HTTP Caching
- related headers
- -->
- <httpCaching never304="true" />
- <!-- If you include a <cacheControl> directive, it will be used to
- generate a Cache-Control header (as well as an Expires header
- if the value contains "max-age=")
-
- By default, no Cache-Control header is generated.
-
- You can use the <cacheControl> option even if you have set
- never304="true"
- -->
- <!--
- <httpCaching never304="true" >
- <cacheControl>max-age=30, public</cacheControl>
- </httpCaching>
- -->
- <!-- To enable Solr to respond with automatically generated HTTP
- Caching headers, and to response to Cache Validation requests
- correctly, set the value of never304="false"
-
- This will cause Solr to generate Last-Modified and ETag
- headers based on the properties of the Index.
-
- The following options can also be specified to affect the
- values of these headers...
-
- lastModFrom - the default value is "openTime" which means the
- Last-Modified value (and validation against If-Modified-Since
- requests) will all be relative to when the current Searcher
- was opened. You can change it to lastModFrom="dirLastMod" if
- you want the value to exactly correspond to when the physical
- index was last modified.
-
- etagSeed="..." is an option you can change to force the ETag
- header (and validation against If-None-Match requests) to be
- different even if the index has not changed (ie: when making
- significant changes to your config file)
-
- (lastModifiedFrom and etagSeed are both ignored if you use
- the never304="true" option)
- -->
- <!--
- <httpCaching lastModifiedFrom="openTime"
- etagSeed="Solr">
- <cacheControl>max-age=30, public</cacheControl>
- </httpCaching>
- -->
- </requestDispatcher>
-
- <!-- Request Handlers
-
- http://wiki.apache.org/solr/SolrRequestHandler
-
- Incoming queries will be dispatched to a specific handler by name
- based on the path specified in the request.
-
- Legacy behavior: If the request path uses "/select" but no Request
- Handler has that name, and if handleSelect="true" has been specified in
- the requestDispatcher, then the Request Handler is dispatched based on
- the qt parameter. Handlers without a leading '/' are accessed this way
- like so: http://host/app/[core/]select?qt=name If no qt is
- given, then the requestHandler that declares default="true" will be
- used or the one named "standard".
-
- If a Request Handler is declared with startup="lazy", then it will
- not be initialized until the first request that uses it.
-
- -->
- <!-- SearchHandler
-
- http://wiki.apache.org/solr/SearchHandler
-
- For processing Search Queries, the primary Request Handler
- provided with Solr is "SearchHandler" It delegates to a sequent
- of SearchComponents (see below) and supports distributed
- queries across multiple shards
- -->
- <requestHandler name="/select" class="solr.SearchHandler">
- <!-- default values for query parameters can be specified, these
- will be overridden by parameters in the request
- -->
- <lst name="defaults">
- <str name="echoParams">explicit</str>
- <int name="rows">10</int>
- <str name="df">text</str>
- </lst>
- <!-- In addition to defaults, "appends" params can be specified
- to identify values which should be appended to the list of
- multi-val params from the query (or the existing "defaults").
- -->
- <!-- In this example, the param "fq=instock:true" would be appended to
- any query time fq params the user may specify, as a mechanism for
- partitioning the index, independent of any user selected filtering
- that may also be desired (perhaps as a result of faceted searching).
-
- NOTE: there is *absolutely* nothing a client can do to prevent these
- "appends" values from being used, so don't use this mechanism
- unless you are sure you always want it.
- -->
- <!--
- <lst name="appends">
- <str name="fq">inStock:true</str>
- </lst>
- -->
- <!-- "invariants" are a way of letting the Solr maintainer lock down
- the options available to Solr clients. Any params values
- specified here are used regardless of what values may be specified
- in either the query, the "defaults", or the "appends" params.
-
- In this example, the facet.field and facet.query params would
- be fixed, limiting the facets clients can use. Faceting is
- not turned on by default - but if the client does specify
- facet=true in the request, these are the only facets they
- will be able to see counts for; regardless of what other
- facet.field or facet.query params they may specify.
-
- NOTE: there is *absolutely* nothing a client can do to prevent these
- "invariants" values from being used, so don't use this mechanism
- unless you are sure you always want it.
- -->
- <!--
- <lst name="invariants">
- <str name="facet.field">cat</str>
- <str name="facet.field">manu_exact</str>
- <str name="facet.query">price:[* TO 500]</str>
- <str name="facet.query">price:[500 TO *]</str>
- </lst>
- -->
- <!-- If the default list of SearchComponents is not desired, that
- list can either be overridden completely, or components can be
- prepended or appended to the default list. (see below)
- -->
- <!--
- <arr name="components">
- <str>nameOfCustomComponent1</str>
- <str>nameOfCustomComponent2</str>
- </arr>
- -->
- </requestHandler>
-
- <!-- A request handler that returns indented JSON by default -->
- <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">text</str>
- </lst>
- </requestHandler>
-
-
- <!-- realtime get handler, guaranteed to return the latest stored fields of
- any document, without the need to commit or open a new searcher. The
- current implementation relies on the updateLog feature being enabled.
-
- ** WARNING **
- Do NOT disable the realtime get handler at /get if you are using
- SolrCloud otherwise any leader election will cause a full sync in ALL
- replicas for the shard in question. Similarly, a replica recovery will
- also always fetch the complete index from the leader because a partial
- sync will not be possible in the absence of this handler.
- -->
- <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>
-
-
- <!-- A Robust Example
-
- This example SearchHandler declaration shows off usage of the
- SearchHandler with many defaults declared
-
- Note that multiple instances of the same Request Handler
- (SearchHandler) can be registered multiple times with different
- names (and different init parameters)
- -->
- <requestHandler name="/browse" class="solr.SearchHandler">
- <lst name="defaults">
- <str name="echoParams">explicit</str>
-
- <!-- VelocityResponseWriter settings -->
- <str name="wt">velocity</str>
- <str name="v.template">browse</str>
- <str name="v.layout">layout</str>
- <str name="title">Solritas</str>
-
- <!-- Query settings -->
- <str name="defType">edismax</str>
- <str name="qf">
- text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
- title^10.0 description^5.0 keywords^5.0 author^2.0 resourcename^1.0
- </str>
- <str name="df">text</str>
- <str name="mm">100%</str>
- <str name="q.alt">*:*</str>
- <str name="rows">10</str>
- <str name="fl">*,score</str>
-
- <str name="mlt.qf">
- text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
- title^10.0 description^5.0 keywords^5.0 author^2.0 resourcename^1.0
- </str>
- <str name="mlt.fl">text,features,name,sku,id,manu,cat,title,description,keywords,author,resourcename</str>
- <int name="mlt.count">3</int>
-
- <!-- Faceting defaults -->
- <str name="facet">on</str>
- <str name="facet.field">cat</str>
- <str name="facet.field">manu_exact</str>
- <str name="facet.field">content_type</str>
- <str name="facet.field">author_s</str>
- <str name="facet.query">ipod</str>
- <str name="facet.query">GB</str>
- <str name="facet.mincount">1</str>
- <str name="facet.pivot">cat,inStock</str>
- <str name="facet.range.other">after</str>
- <str name="facet.range">price</str>
- <int name="f.price.facet.range.start">0</int>
- <int name="f.price.facet.range.end">600</int>
- <int name="f.price.facet.range.gap">50</int>
- <str name="facet.range">popularity</str>
- <int name="f.popularity.facet.range.start">0</int>
- <int name="f.popularity.facet.range.end">10</int>
- <int name="f.popularity.facet.range.gap">3</int>
- <str name="facet.range">manufacturedate_dt</str>
- <str name="f.manufacturedate_dt.facet.range.start">NOW/YEAR-10YEARS</str>
- <str name="f.manufacturedate_dt.facet.range.end">NOW</str>
- <str name="f.manufacturedate_dt.facet.range.gap">+1YEAR</str>
- <str name="f.manufacturedate_dt.facet.range.other">before</str>
- <str name="f.manufacturedate_dt.facet.range.other">after</str>
-
- <!-- Highlighting defaults -->
- <str name="hl">on</str>
- <str name="hl.fl">content features title name</str>
- <str name="hl.encoder">html</str>
- <str name="hl.simple.pre"><b></str>
- <str name="hl.simple.post"></b></str>
- <str name="f.title.hl.fragsize">0</str>
- <str name="f.title.hl.alternateField">title</str>
- <str name="f.name.hl.fragsize">0</str>
- <str name="f.name.hl.alternateField">name</str>
- <str name="f.content.hl.snippets">3</str>
- <str name="f.content.hl.fragsize">200</str>
- <str name="f.content.hl.alternateField">content</str>
- <str name="f.content.hl.maxAlternateFieldLength">750</str>
-
- <!-- Spell checking defaults -->
- <str name="spellcheck">on</str>
- <str name="spellcheck.extendedResults">false</str>
- <str name="spellcheck.count">5</str>
- <str name="spellcheck.alternativeTermCount">2</str>
- <str name="spellcheck.maxResultsForSuggest">5</str>
- <str name="spellcheck.collate">true</str>
- <str name="spellcheck.collateExtendedResults">true</str>
- <str name="spellcheck.maxCollationTries">5</str>
- <str name="spellcheck.maxCollations">3</str>
- </lst>
-
- <!-- append spellchecking to our list of components -->
- <arr name="last-components">
- <str>spellcheck</str>
- </arr>
- </requestHandler>
-
-
- <!-- Update Request Handler.
-
- http://wiki.apache.org/solr/UpdateXmlMessages
-
- The canonical Request Handler for Modifying the Index through
- commands specified using XML, JSON, CSV, or JAVABIN
-
- Note: Since solr1.1 requestHandlers requires a valid content
- type header if posted in the body. For example, curl now
- requires: -H 'Content-type:text/xml; charset=utf-8'
-
- To override the request content type and force a specific
- Content-type, use the request parameter:
- ?update.contentType=text/csv
-
- This handler will pick a response format to match the input
- if the 'wt' parameter is not explicit
- -->
- <requestHandler name="/update" class="solr.UpdateRequestHandler">
- <!-- See below for information on defining
- updateRequestProcessorChains that can be used by name
- on each Update Request
- -->
- <!--
- <lst name="defaults">
- <str name="update.chain">dedupe</str>
- </lst>
- -->
- </requestHandler>
-
- <!-- for back compat with clients using /update/json and /update/csv -->
- <requestHandler name="/update/json" class="solr.UpdateRequestHandler">
- <lst name="defaults">
- <str name="stream.contentType">application/json</str>
- </lst>
- </requestHandler>
- <requestHandler name="/update/csv" class="solr.UpdateRequestHandler">
- <lst name="defaults">
- <str name="stream.contentType">application/csv</str>
- </lst>
- </requestHandler>
-
- <!-- Solr Cell Update Request Handler
-
- http://wiki.apache.org/solr/ExtractingRequestHandler
-
- -->
- <requestHandler name="/update/extract"
- startup="lazy"
- class="solr.extraction.ExtractingRequestHandler" >
- <lst name="defaults">
- <str name="lowernames">true</str>
- <str name="uprefix">ignored_</str>
-
- <!-- capture link hrefs but ignore div attributes -->
- <str name="captureAttr">true</str>
- <str name="fmap.a">links</str>
- <str name="fmap.div">ignored_</str>
- </lst>
- </requestHandler>
-
-
- <!-- Field Analysis Request Handler
-
- RequestHandler that provides much the same functionality as
- analysis.jsp. Provides the ability to specify multiple field
- types and field names in the same request and outputs
- index-time and query-time analysis for each of them.
-
- Request parameters are:
- analysis.fieldname - field name whose analyzers are to be used
-
- analysis.fieldtype - field type whose analyzers are to be used
- analysis.fieldvalue - text for index-time analysis
- q (or analysis.q) - text for query time analysis
- analysis.showmatch (true|false) - When set to true and when
- query analysis is performed, the produced tokens of the
- field value analysis will be marked as "matched" for every
- token that is produces by the query analysis
- -->
- <requestHandler name="/analysis/field"
- startup="lazy"
- class="solr.FieldAnalysisRequestHandler" />
-
-
- <!-- Document Analysis Handler
-
- http://wiki.apache.org/solr/AnalysisRequestHandler
-
- An analysis handler that provides a breakdown of the analysis
- process of provided documents. This handler expects a (single)
- content stream with the following format:
-
- <docs>
- <doc>
- <field name="id">1</field>
- <field name="name">The Name</field>
- <field name="text">The Text Value</field>
- </doc>
- <doc>...</doc>
- <doc>...</doc>
- ...
- </docs>
-
- Note: Each document must contain a field which serves as the
- unique key. This key is used in the returned response to associate
- an analysis breakdown to the analyzed document.
-
- Like the FieldAnalysisRequestHandler, this handler also supports
- query analysis by sending either an "analysis.query" or "q"
- request parameter that holds the query text to be analyzed. It
- also supports the "analysis.showmatch" parameter which when set to
- true, all field tokens that match the query tokens will be marked
- as a "match".
- -->
- <requestHandler name="/analysis/document"
- class="solr.DocumentAnalysisRequestHandler"
- startup="lazy" />
-
- <!-- This single handler is equivalent to the following... -->
- <!--
- <requestHandler name="/admin/luke" class="solr.admin.LukeRequestHandler" />
- <requestHandler name="/admin/system" class="solr.admin.SystemInfoHandler" />
- <requestHandler name="/admin/plugins" class="solr.admin.PluginInfoHandler" />
- <requestHandler name="/admin/threads" class="solr.admin.ThreadDumpHandler" />
- <requestHandler name="/admin/properties" class="solr.admin.PropertiesRequestHandler" />
- <requestHandler name="/admin/file" class="solr.admin.ShowFileRequestHandler" >
- -->
- <!-- If you wish to hide files under ${solr.home}/conf, explicitly
- register the ShowFileRequestHandler using the definition below.
- NOTE: The glob pattern ('*') is the only pattern supported at present, *.xml will
- not exclude all files ending in '.xml'. Use it to exclude _all_ updates
- -->
- <!--
- <requestHandler name="/admin/file"
- class="solr.admin.ShowFileRequestHandler" >
- <lst name="invariants">
- <str name="hidden">synonyms.txt</str>
- <str name="hidden">anotherfile.txt</str>
- <str name="hidden">*</str>
- </lst>
- </requestHandler>
- -->
-
- <!-- ping/healthcheck -->
- <requestHandler name="/admin/ping" class="solr.PingRequestHandler">
- <lst name="invariants">
- <str name="q">solrpingquery</str>
- </lst>
- <lst name="defaults">
- <str name="echoParams">all</str>
- </lst>
- <!-- An optional feature of the PingRequestHandler is to configure the
- handler with a "healthcheckFile" which can be used to enable/disable
- the PingRequestHandler.
- relative paths are resolved against the data dir
- -->
- <!-- <str name="healthcheckFile">server-enabled.txt</str> -->
- </requestHandler>
-
- <!-- Echo the request contents back to the client -->
- <requestHandler name="/debug/dump" class="solr.DumpRequestHandler" >
- <lst name="defaults">
- <str name="echoParams">explicit</str>
- <str name="echoHandler">true</str>
- </lst>
- </requestHandler>
-
- <!-- Solr Replication
-
- The SolrReplicationHandler supports replicating indexes from a
- "master" used for indexing and "slaves" used for queries.
-
- http://wiki.apache.org/solr/SolrReplication
-
- It is also necessary for SolrCloud to function (in Cloud mode, the
- replication handler is used to bulk transfer segments when nodes
- are added or need to recover).
-
- https://wiki.apache.org/solr/SolrCloud/
- -->
- <requestHandler name="/replication" class="solr.ReplicationHandler" >
- <!--
- To enable simple master/slave replication, uncomment one of the
- sections below, depending on whether this solr instance should be
- the "master" or a "slave". If this instance is a "slave" you will
- also need to fill in the masterUrl to point to a real machine.
- -->
- <!--
- <lst name="master">
- <str name="replicateAfter">commit</str>
- <str name="replicateAfter">startup</str>
- <str name="confFiles">schema.xml,stopwords.txt</str>
- </lst>
- -->
- <!--
- <lst name="slave">
- <str name="masterUrl">http://your-master-hostname:8983/solr</str>
- <str name="pollInterval">00:00:60</str>
- </lst>
- -->
- </requestHandler>
-
- <!-- Search Components
-
- Search components are registered to SolrCore and used by
- instances of SearchHandler (which can access them by name)
-
- By default, the following components are available:
-
- <searchComponent name="query" class="solr.QueryComponent" />
- <searchComponent name="facet" class="solr.FacetComponent" />
- <searchComponent name="mlt" class="solr.MoreLikeThisComponent" />
- <searchComponent name="highlight" class="solr.HighlightComponent" />
- <searchComponent name="stats" class="solr.StatsComponent" />
- <searchComponent name="debug" class="solr.DebugComponent" />
-
- Default configuration in a requestHandler would look like:
-
- <arr name="components">
- <str>query</str>
- <str>facet</str>
- <str>mlt</str>
- <str>highlight</str>
- <str>stats</str>
- <str>debug</str>
- </arr>
-
- If you register a searchComponent to one of the standard names,
- that will be used instead of the default.
-
- To insert components before or after the 'standard' components, use:
-
- <arr name="first-components">
- <str>myFirstComponentName</str>
- </arr>
-
- <arr name="last-components">
- <str>myLastComponentName</str>
- </arr>
-
- NOTE: The component registered with the name "debug" will
- always be executed after the "last-components"
-
- -->
-
- <!-- Spell Check
-
- The spell check component can return a list of alternative spelling
- suggestions.
-
- http://wiki.apache.org/solr/SpellCheckComponent
- -->
- <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
-
- <str name="queryAnalyzerFieldType">text_general</str>
-
- <!-- Multiple "Spell Checkers" can be declared and used by this
- component
- -->
-
- <!-- a spellchecker built from a field of the main index -->
- <lst name="spellchecker">
- <str name="name">default</str>
- <str name="field">text</str>
- <str name="classname">solr.DirectSolrSpellChecker</str>
- <!-- the spellcheck distance measure used, the default is the internal levenshtein -->
- <str name="distanceMeasure">internal</str>
- <!-- minimum accuracy needed to be considered a valid spellcheck suggestion -->
- <float name="accuracy">0.5</float>
- <!-- the maximum #edits we consider when enumerating terms: can be 1 or 2 -->
- <int name="maxEdits">2</int>
- <!-- the minimum shared prefix when enumerating terms -->
- <int name="minPrefix">1</int>
- <!-- maximum number of inspections per result. -->
- <int name="maxInspections">5</int>
- <!-- minimum length of a query term to be considered for correction -->
- <int name="minQueryLength">4</int>
- <!-- maximum threshold of documents a query term can appear to be considered for correction -->
- <float name="maxQueryFrequency">0.01</float>
- <!-- uncomment this to require suggestions to occur in 1% of the documents
- <float name="thresholdTokenFrequency">.01</float>
- -->
- </lst>
-
- <!-- a spellchecker that can break or combine words. See "/spell" handler below for usage -->
- <lst name="spellchecker">
- <str name="name">wordbreak</str>
- <str name="classname">solr.WordBreakSolrSpellChecker</str>
- <str name="field">name</str>
- <str name="combineWords">true</str>
- <str name="breakWords">true</str>
- <int name="maxChanges">10</int>
- </lst>
-
- <!-- a spellchecker that uses a different distance measure -->
- <!--
- <lst name="spellchecker">
- <str name="name">jarowinkler</str>
- <str name="field">spell</str>
- <str name="classname">solr.DirectSolrSpellChecker</str>
- <str name="distanceMeasure">
- org.apache.lucene.search.spell.JaroWinklerDistance
- </str>
- </lst>
- -->
-
- <!-- a spellchecker that use an alternate comparator
-
- comparatorClass be one of:
- 1. score (default)
- 2. freq (Frequency first, then score)
- 3. A fully qualified class name
- -->
- <!--
- <lst name="spellchecker">
- <str name="name">freq</str>
- <str name="field">lowerfilt</str>
- <str name="classname">solr.DirectSolrSpellChecker</str>
- <str name="comparatorClass">freq</str>
- -->
-
- <!-- A spellchecker that reads the list of words from a file -->
- <!--
- <lst name="spellchecker">
- <str name="classname">solr.FileBasedSpellChecker</str>
- <str name="name">file</str>
- <str name="sourceLocation">spellings.txt</str>
- <str name="characterEncoding">UTF-8</str>
- <str name="spellcheckIndexDir">spellcheckerFile</str>
- </lst>
- -->
- </searchComponent>
-
- <!-- A request handler for demonstrating the spellcheck component.
-
- NOTE: This is purely as an example. The whole purpose of the
- SpellCheckComponent is to hook it into the request handler that
- handles your normal user queries so that a separate request is
- not needed to get suggestions.
-
- IN OTHER WORDS, THERE IS REALLY GOOD CHANCE THE SETUP BELOW IS
- NOT WHAT YOU WANT FOR YOUR PRODUCTION SYSTEM!
-
- See http://wiki.apache.org/solr/SpellCheckComponent for details
- on the request parameters.
- -->
- <requestHandler name="/spell" class="solr.SearchHandler" startup="lazy">
- <lst name="defaults">
- <str name="df">text</str>
- <!-- Solr will use suggestions from both the 'default' spellchecker
- and from the 'wordbreak' spellchecker and combine them.
- collations (re-written queries) can include a combination of
- corrections from both spellcheckers -->
- <str name="spellcheck.dictionary">default</str>
- <str name="spellcheck.dictionary">wordbreak</str>
- <str name="spellcheck">on</str>
- <str name="spellcheck.extendedResults">true</str>
- <str name="spellcheck.count">10</str>
- <str name="spellcheck.alternativeTermCount">5</str>
- <str name="spellcheck.maxResultsForSuggest">5</str>
- <str name="spellcheck.collate">true</str>
- <str name="spellcheck.collateExtendedResults">true</str>
- <str name="spellcheck.maxCollationTries">10</str>
- <str name="spellcheck.maxCollations">5</str>
- </lst>
- <arr name="last-components">
- <str>spellcheck</str>
- </arr>
- </requestHandler>
-
- <searchComponent name="suggest" class="solr.SuggestComponent">
- <lst name="suggester">
- <str name="name">mySuggester</str>
- <str name="lookupImpl">FuzzyLookupFactory</str> <!-- org.apache.solr.spelling.suggest.fst -->
- <str name="dictionaryImpl">DocumentDictionaryFactory</str> <!-- org.apache.solr.spelling.suggest.HighFrequencyDictionaryFactory -->
- <str name="field">cat</str>
- <str name="weightField">price</str>
- <str name="suggestAnalyzerFieldType">string</str>
- </lst>
- </searchComponent>
-
- <requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy">
- <lst name="defaults">
- <str name="suggest">true</str>
- <str name="suggest.count">10</str>
- </lst>
- <arr name="components">
- <str>suggest</str>
- </arr>
- </requestHandler>
- <!-- Term Vector Component
-
- http://wiki.apache.org/solr/TermVectorComponent
- -->
- <searchComponent name="tvComponent" class="solr.TermVectorComponent"/>
-
- <!-- A request handler for demonstrating the term vector component
-
- This is purely as an example.
-
- In reality you will likely want to add the component to your
- already specified request handlers.
- -->
- <requestHandler name="/tvrh" class="solr.SearchHandler" startup="lazy">
- <lst name="defaults">
- <str name="df">text</str>
- <bool name="tv">true</bool>
- </lst>
- <arr name="last-components">
- <str>tvComponent</str>
- </arr>
- </requestHandler>
-
- <!-- Clustering Component
-
- You'll need to set the solr.clustering.enabled system property
- when running solr to run with clustering enabled:
-
- java -Dsolr.clustering.enabled=true -jar start.jar
-
- http://wiki.apache.org/solr/ClusteringComponent
- http://carrot2.github.io/solr-integration-strategies/
- -->
- <searchComponent name="clustering"
- enable="${solr.clustering.enabled:false}"
- class="solr.clustering.ClusteringComponent" >
- <lst name="engine">
- <str name="name">lingo</str>
-
- <!-- Class name of a clustering algorithm compatible with the Carrot2 framework.
-
- Currently available open source algorithms are:
- * org.carrot2.clustering.lingo.LingoClusteringAlgorithm
- * org.carrot2.clustering.stc.STCClusteringAlgorithm
- * org.carrot2.clustering.kmeans.BisectingKMeansClusteringAlgorithm
-
- See http://project.carrot2.org/algorithms.html for more information.
-
- A commercial algorithm Lingo3G (needs to be installed separately) is defined as:
- * com.carrotsearch.lingo3g.Lingo3GClusteringAlgorithm
- -->
- <str name="carrot.algorithm">org.carrot2.clustering.lingo.LingoClusteringAlgorithm</str>
-
- <!-- Override location of the clustering algorithm's resources
- (attribute definitions and lexical resources).
-
- A directory from which to load algorithm-specific stop words,
- stop labels and attribute definition XMLs.
-
- For an overview of Carrot2 lexical resources, see:
- http://download.carrot2.org/head/manual/#chapter.lexical-resources
-
- For an overview of Lingo3G lexical resources, see:
- http://download.carrotsearch.com/lingo3g/manual/#chapter.lexical-resources
- -->
- <str name="carrot.resourcesDir">clustering/carrot2</str>
- </lst>
-
- <!-- An example definition for the STC clustering algorithm. -->
- <lst name="engine">
- <str name="name">stc</str>
- <str name="carrot.algorithm">org.carrot2.clustering.stc.STCClusteringAlgorithm</str>
- </lst>
-
- <!-- An example definition for the bisecting kmeans clustering algorithm. -->
- <lst name="engine">
- <str name="name">kmeans</str>
- <str name="carrot.algorithm">org.carrot2.clustering.kmeans.BisectingKMeansClusteringAlgorithm</str>
- </lst>
- </searchComponent>
-
- <!-- A request handler for demonstrating the clustering component
-
- This is purely as an example.
-
- In reality you will likely want to add the component to your
- already specified request handlers.
- -->
- <requestHandler name="/clustering"
- startup="lazy"
- enable="${solr.clustering.enabled:false}"
- class="solr.SearchHandler">
- <lst name="defaults">
- <bool name="clustering">true</bool>
- <bool name="clustering.results">true</bool>
- <!-- Field name with the logical "title" of a each document (optional) -->
- <str name="carrot.title">name</str>
- <!-- Field name with the logical "URL" of a each document (optional) -->
- <str name="carrot.url">id</str>
- <!-- Field name with the logical "content" of a each document (optional) -->
- <str name="carrot.snippet">features</str>
- <!-- Apply highlighter to the title/ content and use this for clustering. -->
- <bool name="carrot.produceSummary">true</bool>
- <!-- the maximum number of labels per cluster -->
- <!--<int name="carrot.numDescriptions">5</int>-->
- <!-- produce sub clusters -->
- <bool name="carrot.outputSubClusters">false</bool>
-
- <!-- Configure the remaining request handler parameters. -->
- <str name="defType">edismax</str>
- <str name="qf">
- text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
- </str>
- <str name="q.alt">*:*</str>
- <str name="rows">10</str>
- <str name="fl">*,score</str>
- </lst>
- <arr name="last-components">
- <str>clustering</str>
- </arr>
- </requestHandler>
-
- <!-- Terms Component
-
- http://wiki.apache.org/solr/TermsComponent
-
- A component to return terms and document frequency of those
- terms
- -->
- <searchComponent name="terms" class="solr.TermsComponent"/>
-
- <!-- A request handler for demonstrating the terms component -->
- <requestHandler name="/terms" class="solr.SearchHandler" startup="lazy">
- <lst name="defaults">
- <bool name="terms">true</bool>
- <bool name="distrib">false</bool>
- </lst>
- <arr name="components">
- <str>terms</str>
- </arr>
- </requestHandler>
-
-
- <!-- Query Elevation Component
-
- http://wiki.apache.org/solr/QueryElevationComponent
-
- a search component that enables you to configure the top
- results for a given query regardless of the normal lucene
- scoring.
- -->
- <searchComponent name="elevator" class="solr.QueryElevationComponent" >
- <!-- pick a fieldType to analyze queries -->
- <str name="queryFieldType">string</str>
- <str name="config-file">elevate.xml</str>
- </searchComponent>
-
- <!-- A request handler for demonstrating the elevator component -->
- <requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy">
- <lst name="defaults">
- <str name="echoParams">explicit</str>
- <str name="df">text</str>
- </lst>
- <arr name="last-components">
- <str>elevator</str>
- </arr>
- </requestHandler>
-
- <!-- Highlighting Component
-
- http://wiki.apache.org/solr/HighlightingParameters
- -->
- <searchComponent class="solr.HighlightComponent" name="highlight">
- <highlighting>
- <!-- Configure the standard fragmenter -->
- <!-- This could most likely be commented out in the "default" case -->
- <fragmenter name="gap"
- default="true"
- class="solr.highlight.GapFragmenter">
- <lst name="defaults">
- <int name="hl.fragsize">100</int>
- </lst>
- </fragmenter>
-
- <!-- A regular-expression-based fragmenter
- (for sentence extraction)
- -->
- <fragmenter name="regex"
- class="solr.highlight.RegexFragmenter">
- <lst name="defaults">
- <!-- slightly smaller fragsizes work better because of slop -->
- <int name="hl.fragsize">70</int>
- <!-- allow 50% slop on fragment sizes -->
- <float name="hl.regex.slop">0.5</float>
- <!-- a basic sentence pattern -->
- <str name="hl.regex.pattern">[-\w ,/\n\"']{20,200}</str>
- </lst>
- </fragmenter>
-
- <!-- Configure the standard formatter -->
- <formatter name="html"
- default="true"
- class="solr.highlight.HtmlFormatter">
- <lst name="defaults">
- <str name="hl.simple.pre"><![CDATA[<em>]]></str>
- <str name="hl.simple.post"><![CDATA[</em>]]></str>
- </lst>
- </formatter>
-
- <!-- Configure the standard encoder -->
- <encoder name="html"
- class="solr.highlight.HtmlEncoder" />
-
- <!-- Configure the standard fragListBuilder -->
- <fragListBuilder name="simple"
- class="solr.highlight.SimpleFragListBuilder"/>
-
- <!-- Configure the single fragListBuilder -->
- <fragListBuilder name="single"
- class="solr.highlight.SingleFragListBuilder"/>
-
- <!-- Configure the weighted fragListBuilder -->
- <fragListBuilder name="weighted"
- default="true"
- class="solr.highlight.WeightedFragListBuilder"/>
-
- <!-- default tag FragmentsBuilder -->
- <fragmentsBuilder name="default"
- default="true"
- class="solr.highlight.ScoreOrderFragmentsBuilder">
- <!--
- <lst name="defaults">
- <str name="hl.multiValuedSeparatorChar">/</str>
- </lst>
- -->
- </fragmentsBuilder>
-
- <!-- multi-colored tag FragmentsBuilder -->
- <fragmentsBuilder name="colored"
- class="solr.highlight.ScoreOrderFragmentsBuilder">
- <lst name="defaults">
- <str name="hl.tag.pre"><![CDATA[
- <b style="background:yellow">,<b style="background:lawgreen">,
- <b style="background:aquamarine">,<b style="background:magenta">,
- <b style="background:palegreen">,<b style="background:coral">,
- <b style="background:wheat">,<b style="background:khaki">,
- <b style="background:lime">,<b style="background:deepskyblue">]]></str>
- <str name="hl.tag.post"><![CDATA[</b>]]></str>
- </lst>
- </fragmentsBuilder>
-
- <boundaryScanner name="default"
- default="true"
- class="solr.highlight.SimpleBoundaryScanner">
- <lst name="defaults">
- <str name="hl.bs.maxScan">10</str>
- <str name="hl.bs.chars">.,!? 	 </str>
- </lst>
- </boundaryScanner>
-
- <boundaryScanner name="breakIterator"
- class="solr.highlight.BreakIteratorBoundaryScanner">
- <lst name="defaults">
- <!-- type should be one of CHARACTER, WORD(default), LINE and SENTENCE -->
- <str name="hl.bs.type">WORD</str>
- <!-- language and country are used when constructing Locale object. -->
- <!-- And the Locale object will be used when getting instance of BreakIterator -->
- <str name="hl.bs.language">en</str>
- <str name="hl.bs.country">US</str>
- </lst>
- </boundaryScanner>
- </highlighting>
- </searchComponent>
-
- <!-- Update Processors
-
- Chains of Update Processor Factories for dealing with Update
- Requests can be declared, and then used by name in Update
- Request Processors
-
- http://wiki.apache.org/solr/UpdateRequestProcessor
-
- -->
- <!-- Deduplication
-
- An example dedup update processor that creates the "id" field
- on the fly based on the hash code of some other fields. This
- example has overwriteDupes set to false since we are using the
- id field as the signatureField and Solr will maintain
- uniqueness based on that anyway.
-
- -->
- <!--
- <updateRequestProcessorChain name="dedupe">
- <processor class="solr.processor.SignatureUpdateProcessorFactory">
- <bool name="enabled">true</bool>
- <str name="signatureField">id</str>
- <bool name="overwriteDupes">false</bool>
- <str name="fields">name,features,cat</str>
- <str name="signatureClass">solr.processor.Lookup3Signature</str>
- </processor>
- <processor class="solr.LogUpdateProcessorFactory" />
- <processor class="solr.RunUpdateProcessorFactory" />
- </updateRequestProcessorChain>
- -->
-
- <!-- Language identification
-
- This example update chain identifies the language of the incoming
- documents using the langid contrib. The detected language is
- written to field language_s. No field name mapping is done.
- The fields used for detection are text, title, subject and description,
- making this example suitable for detecting languages form full-text
- rich documents injected via ExtractingRequestHandler.
- See more about langId at http://wiki.apache.org/solr/LanguageDetection
- -->
- <!--
- <updateRequestProcessorChain name="langid">
- <processor class="org.apache.solr.update.processor.TikaLanguageIdentifierUpdateProcessorFactory">
- <str name="langid.fl">text,title,subject,description</str>
- <str name="langid.langField">language_s</str>
- <str name="langid.fallback">en</str>
- </processor>
- <processor class="solr.LogUpdateProcessorFactory" />
- <processor class="solr.RunUpdateProcessorFactory" />
- </updateRequestProcessorChain>
- -->
-
- <!-- Script update processor
-
- This example hooks in an update processor implemented using JavaScript.
-
- See more about the script update processor at http://wiki.apache.org/solr/ScriptUpdateProcessor
- -->
- <!--
- <updateRequestProcessorChain name="script">
- <processor class="solr.StatelessScriptUpdateProcessorFactory">
- <str name="script">update-script.js</str>
- <lst name="params">
- <str name="config_param">example config parameter</str>
- </lst>
- </processor>
- <processor class="solr.RunUpdateProcessorFactory" />
- </updateRequestProcessorChain>
- -->
-
- <!-- Response Writers
-
- http://wiki.apache.org/solr/QueryResponseWriter
-
- Request responses will be written using the writer specified by
- the 'wt' request parameter matching the name of a registered
- writer.
-
- The "default" writer is the default and will be used if 'wt' is
- not specified in the request.
- -->
- <!-- The following response writers are implicitly configured unless
- overridden...
- -->
- <!--
- <queryResponseWriter name="xml"
- default="true"
- class="solr.XMLResponseWriter" />
- <queryResponseWriter name="json" class="solr.JSONResponseWriter"/>
- <queryResponseWriter name="python" class="solr.PythonResponseWriter"/>
- <queryResponseWriter name="ruby" class="solr.RubyResponseWriter"/>
- <queryResponseWriter name="php" class="solr.PHPResponseWriter"/>
- <queryResponseWriter name="phps" class="solr.PHPSerializedResponseWriter"/>
- <queryResponseWriter name="csv" class="solr.CSVResponseWriter"/>
- <queryResponseWriter name="schema.xml" class="solr.SchemaXmlResponseWriter"/>
- -->
-
- <queryResponseWriter name="json" class="solr.JSONResponseWriter">
- <!-- For the purposes of the tutorial, JSON responses are written as
- plain text so that they are easy to read in *any* browser.
- If you expect a MIME type of "application/json" just remove this override.
- -->
- <str name="content-type">text/plain; charset=UTF-8</str>
- </queryResponseWriter>
-
- <!--
- Custom response writers can be declared as needed...
- -->
- <queryResponseWriter name="velocity" class="solr.VelocityResponseWriter" startup="lazy"/>
-
-
- <!-- XSLT response writer transforms the XML output by any xslt file found
- in Solr's conf/xslt directory. Changes to xslt files are checked for
- every xsltCacheLifetimeSeconds.
- -->
- <queryResponseWriter name="xslt" class="solr.XSLTResponseWriter">
- <int name="xsltCacheLifetimeSeconds">5</int>
- </queryResponseWriter>
-
- <!-- Query Parsers
-
- http://wiki.apache.org/solr/SolrQuerySyntax
-
- Multiple QParserPlugins can be registered by name, and then
- used in either the "defType" param for the QueryComponent (used
- by SearchHandler) or in LocalParams
- -->
- <!-- example of registering a query parser -->
- <!--
- <queryParser name="myparser" class="com.mycompany.MyQParserPlugin"/>
- -->
-
- <!-- Function Parsers
-
- http://wiki.apache.org/solr/FunctionQuery
-
- Multiple ValueSourceParsers can be registered by name, and then
- used as function names when using the "func" QParser.
- -->
- <!-- example of registering a custom function parser -->
- <!--
- <valueSourceParser name="myfunc"
- class="com.mycompany.MyValueSourceParser" />
- -->
-
-
- <!-- Document Transformers
- http://wiki.apache.org/solr/DocTransformers
- -->
- <!--
- Could be something like:
- <transformer name="db" class="com.mycompany.LoadFromDatabaseTransformer" >
- <int name="connection">jdbc://....</int>
- </transformer>
-
- To add a constant value to all docs, use:
- <transformer name="mytrans2" class="org.apache.solr.response.transform.ValueAugmenterFactory" >
- <int name="value">5</int>
- </transformer>
-
- If you want the user to still be able to change it with _value:something_ use this:
- <transformer name="mytrans3" class="org.apache.solr.response.transform.ValueAugmenterFactory" >
- <double name="defaultValue">5</double>
- </transformer>
-
- If you are using the QueryElevationComponent, you may wish to mark documents that get boosted. The
- EditorialMarkerFactory will do exactly that:
- <transformer name="qecBooster" class="org.apache.solr.response.transform.EditorialMarkerFactory" />
- -->
-
-
- <!-- Legacy config for the admin interface -->
- <admin>
- <defaultQuery>*:*</defaultQuery>
- </admin>
-
-</config>
diff --git a/components/camel-solr/src/test/resources/solr/collection1/conf/spellings.txt b/components/camel-solr/src/test/resources/solr/collection1/conf/spellings.txt
deleted file mode 100644
index 162a044d561..00000000000
--- a/components/camel-solr/src/test/resources/solr/collection1/conf/spellings.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-pizza
-history
diff --git a/components/camel-solr/src/test/resources/solr/collection1/conf/stopwords.txt b/components/camel-solr/src/test/resources/solr/collection1/conf/stopwords.txt
deleted file mode 100644
index ae1e83eeb3d..00000000000
--- a/components/camel-solr/src/test/resources/solr/collection1/conf/stopwords.txt
+++ /dev/null
@@ -1,14 +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.
diff --git a/components/camel-solr/src/test/resources/solr/collection1/conf/stopwords_en.txt b/components/camel-solr/src/test/resources/solr/collection1/conf/stopwords_en.txt
deleted file mode 100644
index 2c164c0b2a1..00000000000
--- a/components/camel-solr/src/test/resources/solr/collection1/conf/stopwords_en.txt
+++ /dev/null
@@ -1,54 +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.
-
-# 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
diff --git a/components/camel-solr/src/test/resources/solr/collection1/conf/synonyms.txt b/components/camel-solr/src/test/resources/solr/collection1/conf/synonyms.txt
deleted file mode 100644
index 7f72128303b..00000000000
--- a/components/camel-solr/src/test/resources/solr/collection1/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
-
diff --git a/components/camel-solr/src/test/resources/solr/collection1/core.properties b/components/camel-solr/src/test/resources/solr/collection1/core.properties
deleted file mode 100644
index 1b949ee54a3..00000000000
--- a/components/camel-solr/src/test/resources/solr/collection1/core.properties
+++ /dev/null
@@ -1,19 +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
-
diff --git a/components/camel-solr/src/test/resources/solr/conf/collection1/elevate.xml b/components/camel-solr/src/test/resources/solr/conf/collection1/elevate.xml
deleted file mode 100644
index 27474324eed..00000000000
--- a/components/camel-solr/src/test/resources/solr/conf/collection1/elevate.xml
+++ /dev/null
@@ -1,37 +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.
-
--->
-<!-- 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.
--->
-
-<elevate>
- <query text="foo bar">
- <doc id="1" />
- <doc id="2" />
- <doc id="3" />
- </query>
-
- <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>
diff --git a/components/camel-solr/src/test/resources/solr/conf/collection1/protwords.txt b/components/camel-solr/src/test/resources/solr/conf/collection1/protwords.txt
deleted file mode 100644
index 1dfc0abecbf..00000000000
--- a/components/camel-solr/src/test/resources/solr/conf/collection1/protwords.txt
+++ /dev/null
@@ -1,21 +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.
-
-#-----------------------------------------------------------------------
-# 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
-
diff --git a/components/camel-solr/src/test/resources/solr/conf/collection1/schema.xml b/components/camel-solr/src/test/resources/solr/conf/collection1/schema.xml
deleted file mode 100644
index e0d526903ba..00000000000
--- a/components/camel-solr/src/test/resources/solr/conf/collection1/schema.xml
+++ /dev/null
@@ -1,643 +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 the Solr schema file. This file should be named "schema.xml" and
- should be in the conf directory under the solr home
- (i.e. ./solr/conf/schema.xml by default)
- or located where the classloader for the Solr webapp can find it.
-
- This example schema is the recommended starting point for users.
- It should be kept correct and concise, usable out-of-the-box.
-
- For more information, on how to customize this file, please see
- http://wiki.apache.org/solr/SchemaXml
-
- PERFORMANCE NOTE: this schema includes many optional features and should not
- be used for benchmarking. To improve performance one could
- - set stored="false" for all fields possible (esp large fields) when you
- only need to search on the field but don't need to return the original
- value.
- - set indexed="false" if you don't need to search on the field, but only
- return the field as a result of searching on other indexed fields.
- - remove all unneeded copyField statements
- - for best index size and searching performance, set "index" to false
- for all general text fields, use copyField to copy them to the
- catchall "text" field, and use that for searching.
- - For maximum indexing performance, use the StreamingUpdateSolrServer
- java client.
- - Remember to run the JVM in server mode, and use a higher logging level
- that avoids logging every request
--->
-
-<schema name="example" version="1.4">
- <!-- attribute "name" is the name of this schema and is only used for display purposes.
- Applications should change this to reflect the nature of the search collection.
- version="1.4" is Solr's version number for the schema syntax and semantics. It should
- not normally be changed by applications.
- 1.0: multiValued attribute did not exist, all fields are multiValued by nature
- 1.1: multiValued attribute introduced, false by default
- 1.2: omitTermFreqAndPositions attribute introduced, true by default except for text fields.
- 1.3: removed optional field compress feature
- 1.4: default auto-phrase (QueryParser feature) to off
- -->
-
- <types>
- <!-- field type definitions. The "name" attribute is
- just a label to be used by field definitions. The "class"
- attribute and any other attributes determine the real
- behavior of the fieldType.
- Class names starting with "solr" refer to java classes in the
- org.apache.solr.analysis package.
- -->
-
- <!-- The StrField type is not analyzed, but indexed/stored verbatim. -->
- <fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/>
-
- <!-- boolean type: "true" or "false" -->
- <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true" omitNorms="true"/>
- <!--Binary data type. The data should be sent/retrieved in as Base64 encoded Strings -->
- <fieldtype name="binary" class="solr.BinaryField"/>
-
- <!-- The optional sortMissingLast and sortMissingFirst attributes are
- currently supported on types that are sorted internally as strings.
- This includes "string","boolean","sint","slong","sfloat","sdouble","pdate"
- - If sortMissingLast="true", then a sort on this field will cause documents
- without the field to come after documents with the field,
- regardless of the requested sort order (asc or desc).
- - If sortMissingFirst="true", then a sort on this field will cause documents
- without the field to come before documents with the field,
- regardless of the requested sort order.
- - If sortMissingLast="false" and sortMissingFirst="false" (the default),
- then default lucene sorting will be used which places docs without the
- field first in an ascending sort and last in a descending sort.
- -->
-
- <!--
- Default numeric field types. For faster range queries, consider the tint/tfloat/tlong/tdouble types.
- -->
- <fieldType name="int" class="solr.IntPointField" omitNorms="true" positionIncrementGap="0"/>
- <fieldType name="float" class="solr.FloatPointField" omitNorms="true" positionIncrementGap="0"/>
- <fieldType name="long" class="solr.LongPointField" omitNorms="true" positionIncrementGap="0"/>
- <fieldType name="double" class="solr.DoublePointField" omitNorms="true" positionIncrementGap="0"/>
-
- <!--
- Numeric field types that index each value at various levels of precision
- to accelerate range queries when the number of values between the range
- endpoints is large. See the javadoc for NumericRangeQuery for internal
- implementation details.
-
- Smaller precisionStep values (specified in bits) will lead to more tokens
- indexed per value, slightly larger index size, and faster range queries.
- A precisionStep of 0 disables indexing at different precision levels.
- -->
- <fieldType name="tint" class="solr.IntPointField" omitNorms="true" positionIncrementGap="0"/>
- <fieldType name="tfloat" class="solr.FloatPointField" omitNorms="true" positionIncrementGap="0"/>
- <fieldType name="tlong" class="solr.LongPointField" omitNorms="true" positionIncrementGap="0"/>
- <fieldType name="tdouble" class="solr.DoublePointField" omitNorms="true" positionIncrementGap="0"/>
-
- <!-- The format for this date field is of the form 1995-12-31T23:59:59Z, and
- is a more restricted form of the canonical representation of dateTime
- http://www.w3.org/TR/xmlschema-2/#dateTime
- The trailing "Z" designates UTC time and is mandatory.
- Optional fractional seconds are allowed: 1995-12-31T23:59:59.999Z
- All other components are mandatory.
-
- Expressions can also be used to denote calculations that should be
- performed relative to "NOW" to determine the value, ie...
-
- NOW/HOUR
- ... Round to the start of the current hour
- NOW-1DAY
- ... Exactly 1 day prior to now
- NOW/DAY+6MONTHS+3DAYS
- ... 6 months and 3 days in the future from the start of
- the current day
-
- Consult the DateField javadocs for more information.
-
- Note: For faster range queries, consider the tdate type
- -->
- <fieldType name="date" class="solr.DatePointField" omitNorms="true" positionIncrementGap="0"/>
-
- <!-- A Trie based date field for faster date range queries and date faceting. -->
- <fieldType name="tdate" class="solr.DatePointField" omitNorms="true" positionIncrementGap="0"/>
-
-
- <!--
- Note:
- These should only be used for compatibility with existing indexes (created with older Solr versions)
- or if "sortMissingFirst" or "sortMissingLast" functionality is needed. Use Trie based fields instead.
-
- Plain numeric field types that store and index the text
- value verbatim (and hence don't support range queries, since the
- lexicographic ordering isn't equal to the numeric ordering)
- -->
- <fieldType name="pint" class="solr.IntField" omitNorms="true"/>
- <fieldType name="plong" class="solr.LongField" omitNorms="true"/>
- <fieldType name="pfloat" class="solr.FloatField" omitNorms="true"/>
- <fieldType name="pdouble" class="solr.DoubleField" omitNorms="true"/>
- <fieldType name="pdate" class="solr.DateField" sortMissingLast="true" omitNorms="true"/>
-
-
- <!--
- Note:
- These should only be used for compatibility with existing indexes (created with older Solr versions)
- or if "sortMissingFirst" or "sortMissingLast" functionality is needed. Use Trie based fields instead.
-
- Numeric field types that manipulate the value into
- a string value that isn't human-readable in its internal form,
- but with a lexicographic ordering the same as the numeric ordering,
- so that range queries work correctly.
- -->
- <fieldType name="sint" class="solr.SortableIntField" sortMissingLast="true" omitNorms="true"/>
- <fieldType name="slong" class="solr.SortableLongField" sortMissingLast="true" omitNorms="true"/>
- <fieldType name="sfloat" class="solr.SortableFloatField" sortMissingLast="true" omitNorms="true"/>
- <fieldType name="sdouble" class="solr.SortableDoubleField" sortMissingLast="true" omitNorms="true"/>
-
-
- <!-- The "RandomSortField" is not used to store or search any
- data. You can declare fields of this type it in your schema
- to generate pseudo-random orderings of your docs for sorting
- purposes. The ordering is generated based on the field name
- and the version of the index, As long as the index version
- remains unchanged, and the same field name is reused,
- the ordering of the docs will be consistent.
- If you want different psuedo-random orderings of documents,
- for the same version of the index, use a dynamicField and
- change the name
- -->
- <fieldType name="random" class="solr.RandomSortField" indexed="true" />
-
- <!-- solr.TextField allows the specification of custom text analyzers
- specified as a tokenizer and a list of token filters. Different
- analyzers may be specified for indexing and querying.
-
- The optional positionIncrementGap puts space between multiple fields of
- this type on the same document, with the purpose of preventing false phrase
- matching across fields.
-
- For more info on customizing your analyzer chain, please see
- http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters
- -->
-
- <!-- One can also specify an existing Analyzer class that has a
- default constructor via the class attribute on the analyzer element
- <fieldType name="text_greek" class="solr.TextField">
- <analyzer class="org.apache.lucene.analysis.el.GreekAnalyzer"/>
- </fieldType>
- -->
-
- <!-- A text field that only splits on whitespace for exact matching of words -->
- <fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100">
- <analyzer>
- <tokenizer class="solr.WhitespaceTokenizerFactory"/>
- </analyzer>
- </fieldType>
-
- <!-- A general text field that has reasonable, generic
- cross-language defaults: it tokenizes with StandardTokenizer,
- removes stop words from case-insensitive "stopwords.txt"
- (empty by default), and down cases. At query time only, it
- also applies synonyms. -->
- <fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
- <analyzer type="index">
- <tokenizer class="solr.StandardTokenizerFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
- <!-- in this example, we will only use synonyms at query time
- <filter class="solr.FlattenGraphFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
- -->
- <filter class="solr.LowerCaseFilterFactory"/>
- </analyzer>
- <analyzer type="query">
- <tokenizer class="solr.StandardTokenizerFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
- <filter class="solr.SynonymGraphFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
- <filter class="solr.LowerCaseFilterFactory"/>
- </analyzer>
- </fieldType>
-
- <!-- A text field with defaults appropriate for English: it
- tokenizes with StandardTokenizer, removes English stop words
- (stopwords_en.txt), down cases, protects words from protwords.txt, and
- finally applies Porter's stemming. The query time analyzer
- also applies synonyms from synonyms.txt. -->
- <fieldType name="text_en" class="solr.TextField" positionIncrementGap="100">
- <analyzer type="index">
- <tokenizer class="solr.StandardTokenizerFactory"/>
- <!-- in this example, we will only use synonyms at query time
- <filter class="solr.FlattenGraphFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
- -->
- <!-- Case insensitive stop word removal.
- -->
- <filter class="solr.StopFilterFactory"
- ignoreCase="true"
- words="stopwords_en.txt"
- />
- <filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.EnglishPossessiveFilterFactory"/>
- <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
- <!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory:
- <filter class="solr.EnglishMinimalStemFilterFactory"/>
- -->
- <filter class="solr.PorterStemFilterFactory"/>
- </analyzer>
- <analyzer type="query">
- <tokenizer class="solr.StandardTokenizerFactory"/>
- <filter class="solr.SynonymGraphFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
- <filter class="solr.StopFilterFactory"
- ignoreCase="true"
- words="stopwords_en.txt"
- enablePositionIncrements="true"
- />
- <filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.EnglishPossessiveFilterFactory"/>
- <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
- <!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory:
- <filter class="solr.EnglishMinimalStemFilterFactory"/>
- -->
- <filter class="solr.PorterStemFilterFactory"/>
- </analyzer>
- </fieldType>
-
- <!-- A text field with defaults appropriate for English, plus
- aggressive word-splitting and autophrase features enabled.
- This field is just like text_en, except it adds
- WordDelimiterFilter to enable splitting and matching of
- words on case-change, alpha numeric boundaries, and
- non-alphanumeric chars. This means certain compound word
- cases will work, for example query "wi fi" will match
- document "WiFi" or "wi-fi". However, other cases will still
- not match, for example if the query is "wifi" and the
- document is "wi fi" or if the query is "wi-fi" and the
- document is "wifi".
- -->
- <fieldType name="text_en_splitting" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
- <analyzer type="index">
- <tokenizer class="solr.WhitespaceTokenizerFactory"/>
- <!-- in this example, we will only use synonyms at query time
- <filter class="solr.FlattenGraphFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
- -->
- <!-- Case insensitive stop word removal.
- -->
- <filter class="solr.StopFilterFactory"
- ignoreCase="true"
- words="stopwords_en.txt"
- />
- <filter class="solr.WordDelimiterGraphFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
- <filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
- <filter class="solr.PorterStemFilterFactory"/>
- </analyzer>
- <analyzer type="query">
- <tokenizer class="solr.WhitespaceTokenizerFactory"/>
- <filter class="solr.SynonymGraphFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
- <filter class="solr.StopFilterFactory"
- ignoreCase="true"
- words="stopwords_en.txt"
- enablePositionIncrements="true"
- />
- <filter class="solr.WordDelimiterGraphFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
- <filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
- <filter class="solr.PorterStemFilterFactory"/>
- </analyzer>
- </fieldType>
-
- <!-- Less flexible matching, but less false matches. Probably not ideal for product names,
- but may be good for SKUs. Can insert dashes in the wrong place and still match. -->
- <fieldType name="text_en_splitting_tight" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
- <analyzer>
- <tokenizer class="solr.WhitespaceTokenizerFactory"/>
- <filter class="solr.SynonymGraphFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="false"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords_en.txt"/>
- <filter class="solr.WordDelimiterGraphFilterFactory" generateWordParts="0" generateNumberParts="0" catenateWords="1" catenateNumbers="1" catenateAll="0"/>
- <filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
- <filter class="solr.EnglishMinimalStemFilterFactory"/>
- <!-- this filter can remove any duplicate tokens that appear at the same position - sometimes
- possible with WordDelimiterFilter in conjuncton with stemming. -->
- <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
- </analyzer>
- </fieldType>
-
- <!-- Just like text_general except it reverses the characters of
- each token, to enable more efficient leading wildcard queries. -->
- <fieldType name="text_general_rev" class="solr.TextField" positionIncrementGap="100">
- <analyzer type="index">
- <tokenizer class="solr.StandardTokenizerFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
- <filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.ReversedWildcardFilterFactory" withOriginal="true"
- maxPosAsterisk="3" maxPosQuestion="2" maxFractionAsterisk="0.33"/>
- </analyzer>
- <analyzer type="query">
- <tokenizer class="solr.StandardTokenizerFactory"/>
- <filter class="solr.SynonymGraphFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
- <filter class="solr.LowerCaseFilterFactory"/>
- </analyzer>
- </fieldType>
-
- <!-- charFilter + WhitespaceTokenizer -->
- <!--
- <fieldType name="text_char_norm" class="solr.TextField" positionIncrementGap="100" >
- <analyzer>
- <charFilter class="solr.MappingCharFilterFactory" mapping="mapping-ISOLatin1Accent.txt"/>
- <tokenizer class="solr.WhitespaceTokenizerFactory"/>
- </analyzer>
- </fieldType>
- -->
-
- <!-- This is an example of using the KeywordTokenizer along
- With various TokenFilterFactories to produce a sortable field
- that does not include some properties of the source text
- -->
- <fieldType name="alphaOnlySort" class="solr.TextField" sortMissingLast="true" omitNorms="true">
- <analyzer>
- <!-- KeywordTokenizer does no actual tokenizing, so the entire
- input string is preserved as a single token
- -->
- <tokenizer class="solr.KeywordTokenizerFactory"/>
- <!-- The LowerCase TokenFilter does what you expect, which can be
- when you want your sorting to be case insensitive
- -->
- <filter class="solr.LowerCaseFilterFactory" />
- <!-- The TrimFilter removes any leading or trailing whitespace -->
- <filter class="solr.TrimFilterFactory" />
- <!-- The PatternReplaceFilter gives you the flexibility to use
- Java Regular expression to replace any sequence of characters
- matching a pattern with an arbitrary replacement string,
- which may include back references to portions of the original
- string matched by the pattern.
-
- See the Java Regular Expression documentation for more
- information on pattern and replacement string syntax.
-
- http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/package-summary.html
- -->
- <filter class="solr.PatternReplaceFilterFactory"
- pattern="([^a-z])" replacement="" replace="all"
- />
- </analyzer>
- </fieldType>
-
- <fieldtype name="phonetic" stored="false" indexed="true" class="solr.TextField" >
- <analyzer>
- <tokenizer class="solr.StandardTokenizerFactory"/>
- <filter class="solr.DoubleMetaphoneFilterFactory" inject="false"/>
- </analyzer>
- </fieldtype>
-
- <fieldtype name="payloads" stored="false" indexed="true" class="solr.TextField" >
- <analyzer>
- <tokenizer class="solr.WhitespaceTokenizerFactory"/>
- <!--
- The DelimitedPayloadTokenFilter can put payloads on tokens... for example,
- a token of "foo|1.4" would be indexed as "foo" with a payload of 1.4f
- Attributes of the DelimitedPayloadTokenFilterFactory :
- "delimiter" - a one character delimiter. Default is | (pipe)
- "encoder" - how to encode the following value into a playload
- float -> org.apache.lucene.analysis.payloads.FloatEncoder,
- integer -> o.a.l.a.p.IntegerEncoder
- identity -> o.a.l.a.p.IdentityEncoder
- Fully Qualified class name implementing PayloadEncoder, Encoder must have a no arg constructor.
- -->
- <filter class="solr.DelimitedPayloadTokenFilterFactory" encoder="float"/>
- </analyzer>
- </fieldtype>
-
- <!-- lowercases the entire field value, keeping it as a single token. -->
- <fieldType name="lowercase" class="solr.TextField" positionIncrementGap="100">
- <analyzer>
- <tokenizer class="solr.KeywordTokenizerFactory"/>
- <filter class="solr.LowerCaseFilterFactory" />
- </analyzer>
- </fieldType>
-
- <fieldType name="text_path" class="solr.TextField" positionIncrementGap="100">
- <analyzer>
- <tokenizer class="solr.PathHierarchyTokenizerFactory"/>
- </analyzer>
- </fieldType>
-
- <!-- since fields of this type are by default not stored or indexed,
- any data added to them will be ignored outright. -->
- <fieldtype name="ignored" stored="false" indexed="false" multiValued="true" class="solr.StrField" />
-
- <!-- This point type indexes the coordinates as separate fields (subFields)
- If subFieldType is defined, it references a type, and a dynamic field
- definition is created matching *___<typename>. Alternately, if
- subFieldSuffix is defined, that is used to create the subFields.
- Example: if subFieldType="double", then the coordinates would be
- indexed in fields myloc_0___double,myloc_1___double.
- Example: if subFieldSuffix="_d" then the coordinates would be indexed
- in fields myloc_0_d,myloc_1_d
- The subFields are an implementation detail of the fieldType, and end
- users normally should not need to know about them.
- -->
- <fieldType name="point" class="solr.PointType" dimension="2" subFieldSuffix="_d"/>
-
- <!-- A specialized field for geospatial search. If indexed, this fieldType must not be multivalued. -->
- <fieldType name="location" class="solr.LatLonPointSpatialField"/>
-
- <!--
- A Geohash is a compact representation of a latitude longitude pair in a single field.
- See http://wiki.apache.org/solr/SpatialSearch
- -->
- <fieldtype name="geohash" class="solr.LatLonPointSpatialField"/>
- </types>
-
-
- <fields>
- <!-- Valid attributes for fields:
- name: mandatory - the name for the field
- type: mandatory - the name of a previously defined type from the
- <types> section
- indexed: true if this field should be indexed (searchable or sortable)
- stored: true if this field should be retrievable
- multiValued: true if this field may contain multiple values per document
- omitNorms: (expert) set to true to omit the norms associated with
- this field (this disables length normalization and index-time
- boosting for the field, and saves some memory). Only full-text
- fields or fields that need an index-time boost need norms.
- termVectors: [false] set to true to store the term vector for a
- given field.
- When using MoreLikeThis, fields used for similarity should be
- stored for best performance.
- termPositions: Store position information with the term vector.
- This will increase storage costs.
- termOffsets: Store offset information with the term vector. This
- will increase storage costs.
- default: a value that should be used if no value is specified
- when adding a document.
- -->
-
- <field name="id" type="string" indexed="true" stored="true" required="true" />
- <field name="sku" type="text_en_splitting_tight" indexed="true" stored="true" omitNorms="true"/>
- <field name="name" type="text_general" indexed="true" stored="true"/>
- <field name="alphaNameSort" type="alphaOnlySort" indexed="true" stored="false"/>
- <field name="manu" type="text_general" indexed="true" stored="true" omitNorms="true"/>
- <field name="cat" type="string" indexed="true" stored="true" multiValued="true"/>
- <field name="features" type="text_general" indexed="true" stored="true" multiValued="true"/>
- <field name="includes" type="text_general" indexed="true" stored="true" termVectors="true" termPositions="true" termOffsets="true" />
-
- <field name="weight" type="float" indexed="true" stored="true"/>
- <field name="price" type="float" indexed="true" stored="true"/>
- <field name="popularity" type="int" indexed="true" stored="true" />
- <field name="inStock" type="boolean" indexed="true" stored="true" />
-
- <!--
- The following store examples are used to demonstrate the various ways one might _CHOOSE_ to
- implement spatial. It is highly unlikely that you would ever have ALL of these fields defined.
- -->
- <field name="store" type="location" indexed="true" stored="true"/>
-
- <!-- Common metadata fields, named specifically to match up with
- SolrCell metadata when parsing rich documents such as Word, PDF.
- Some fields are multiValued only because Tika currently may return
- multiple values for them.
- -->
- <field name="title" type="text_general" indexed="true" stored="true" multiValued="true"/>
- <field name="subject" type="text_general" indexed="true" stored="true"/>
- <field name="description" type="text_general" indexed="true" stored="true"/>
- <field name="comments" type="text_general" indexed="true" stored="true"/>
- <field name="author" type="text_general" indexed="true" stored="true"/>
- <field name="keywords" type="text_general" indexed="true" stored="true"/>
- <field name="category" type="text_general" indexed="true" stored="true"/>
- <field name="content_type" type="string" indexed="true" stored="true" multiValued="true"/>
- <field name="last_modified" type="date" indexed="true" stored="true"/>
- <field name="links" type="string" indexed="true" stored="true" multiValued="true"/>
-
-
- <!-- catchall field, containing all other searchable text fields (implemented
- via copyField further on in this schema -->
- <field name="text" type="text_general" indexed="true" stored="false" multiValued="true"/>
-
- <!-- catchall text field that indexes tokens both normally and in reverse for efficient
- leading wildcard queries. -->
- <field name="text_rev" type="text_general_rev" indexed="true" stored="false" multiValued="true"/>
-
- <!-- non-tokenized version of manufacturer to make it easier to sort or group
- results by manufacturer. copied from "manu" via copyField -->
- <field name="manu_exact" type="string" indexed="true" stored="false"/>
-
- <field name="payloads" type="payloads" indexed="true" stored="true"/>
-
- <!-- Uncommenting the following will create a "timestamp" field using
- a default value of "NOW" to indicate when each document was indexed.
- -->
- <!--
- <field name="timestamp" type="date" indexed="true" stored="true" default="NOW" multiValued="false"/>
- -->
-
-
- <!-- Dynamic field definitions. If a field name is not found, dynamicFields
- will be used if the name matches any of the patterns.
- RESTRICTION: the glob-like pattern in the name attribute must have
- a "*" only at the start or the end.
- EXAMPLE: name="*_i" will match any field ending in _i (like myid_i, z_i)
- Longer patterns will be matched first. if equal size patterns
- both match, the first appearing in the schema will be used. -->
- <dynamicField name="*_i" type="int" indexed="true" stored="true"/>
- <dynamicField name="*_s" type="string" indexed="true" stored="true"/>
- <dynamicField name="*_l" type="long" indexed="true" stored="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="*_f" type="float" indexed="true" stored="true"/>
- <dynamicField name="*_d" type="double" indexed="true" stored="true"/>
-
- <!-- Type used to index the lat and lon components for the "location" FieldType -->
- <dynamicField name="*_coordinate" type="tdouble" indexed="true" stored="false"/>
-
- <dynamicField name="*_dt" type="date" indexed="true" stored="true"/>
- <dynamicField name="*_p" type="location" indexed="true" stored="true"/>
-
- <!-- some trie-coded dynamic fields for faster range queries -->
- <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="ignored_*" type="ignored" multiValued="true"/>
- <dynamicField name="attr_*" type="text_general" indexed="true" stored="true" multiValued="true"/>
-
- <dynamicField name="random_*" type="random" />
-
- <!-- uncomment the following to ignore any fields that don't already match an existing
- field name or dynamic field, rather than reporting them as an error.
- alternately, change the type="ignored" to some other type e.g. "text" if you want
- unknown fields indexed and/or stored by default -->
- <!--dynamicField name="*" type="ignored" multiValued="true" /-->
-
- </fields>
-
- <!-- Field to use to determine and enforce document uniqueness.
- Unless this field is marked with required="false", it will be a required field
- -->
- <uniqueKey>id</uniqueKey>
-
- <!-- field for the QueryParser to use when an explicit fieldname is absent -->
- <defaultSearchField>text</defaultSearchField>
-
- <!-- SolrQueryParser configuration: defaultOperator="AND|OR" -->
- <solrQueryParser defaultOperator="OR"/>
-
- <!-- copyField commands copy one field to another at the time a document
- is added to the index. It's used either to index the same field differently,
- or to add multiple fields to the same field for easier/faster searching. -->
-
- <copyField source="cat" dest="text"/>
- <copyField source="name" dest="text"/>
- <copyField source="manu" dest="text"/>
- <copyField source="features" dest="text"/>
- <copyField source="includes" dest="text"/>
- <copyField source="manu" dest="manu_exact"/>
-
- <!-- Above, multiple source fields are copied to the [text] field.
- Another way to map multiple source fields to the same
- destination field is to use the dynamic field syntax.
- copyField also supports a maxChars to copy setting. -->
-
- <!-- <copyField source="*_t" dest="text" maxChars="3000"/> -->
-
- <!-- copy name to alphaNameSort, a field designed for sorting by name -->
- <!-- <copyField source="name" dest="alphaNameSort"/> -->
-
-
- <!-- Similarity is the scoring routine for each document vs. a query.
- A custom similarity may be specified here, but the default is fine
- for most applications. -->
- <!-- <similarity class="org.apache.lucene.search.DefaultSimilarity"/> -->
- <!-- ... OR ...
- Specify a SimilarityFactory class name implementation
- allowing parameters to be used.
- -->
- <!--
- <similarity class="com.example.solr.CustomSimilarityFactory">
- <str name="paramkey">param value</str>
- </similarity>
- -->
-
-
-</schema>
diff --git a/components/camel-solr/src/test/resources/solr/conf/collection1/scripts.conf b/components/camel-solr/src/test/resources/solr/conf/collection1/scripts.conf
deleted file mode 100644
index f58b262ae0c..00000000000
--- a/components/camel-solr/src/test/resources/solr/conf/collection1/scripts.conf
+++ /dev/null
@@ -1,24 +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.
-
-user=
-solr_hostname=localhost
-solr_port=8983
-rsyncd_port=18983
-data_dir=
-webapp_name=solr
-master_host=
-master_data_dir=
-master_status_dir=
diff --git a/components/camel-solr/src/test/resources/solr/conf/collection1/solrconfig.xml b/components/camel-solr/src/test/resources/solr/conf/collection1/solrconfig.xml
deleted file mode 100644
index 4e07399b0a0..00000000000
--- a/components/camel-solr/src/test/resources/solr/conf/collection1/solrconfig.xml
+++ /dev/null
@@ -1,1872 +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>
- <!-- In all configuration below, a prefix of "solr." for class names
- is an alias that causes solr to search appropriate packages,
- including org.apache.solr.(search|update|request|core|analysis)
-
- You may also specify a fully qualified Java classname if you
- have your own custom plugins.
- -->
-
- <!-- Controls what version of Lucene various components of Solr
- adhere to. Generally, you want to use the latest version to
- get all bug fixes and improvements. It is highly recommended
- that you fully re-index after changing this setting as it can
- affect both how text is indexed and queried.
- -->
- <luceneMatchVersion>7.2.1</luceneMatchVersion>
-
- <!-- <lib/> directives can be used to instruct Solr to load an Jars
- identified and use them to resolve any "plugins" specified in
- your solrconfig.xml or schema.xml (ie: Analyzers, Request
- Handlers, etc...).
-
- All directories and paths are resolved relative to the
- instanceDir.
-
- Please note that <lib/> directives are processed in the order
- that they appear in your solrconfig.xml file, and are "stacked"
- on top of each other when building a ClassLoader - so if you have
- plugin jars with dependencies on other jars, the "lower level"
- dependency jars should be loaded first.
-
- If a "./lib" directory exists in your instanceDir, all files
- found in it are included as if you had used the following
- syntax...
-
- <lib dir="./lib" />
- -->
-
- <!-- A 'dir' option by itself adds any files found in the directory
- to the classpath, this is useful for including all jars in a
- directory.
-
- When a 'regex' is specified in addition to a 'dir', only the
- files in that directory which completely match the regex
- (anchored on both ends) will be included.
-
- If a 'dir' option (with or without a regex) is used and nothing
- is found that matches, a warning will be logged.
-
- The examples below can be used to load some solr-contribs along
- with their external dependencies.
- -->
- <lib dir="../../../contrib/extraction/lib" regex=".*\.jar" />
- <lib dir="../../../dist/" regex="solr-cell-\d.*\.jar" />
-
- <lib dir="../../../contrib/clustering/lib/" regex=".*\.jar" />
- <lib dir="../../../dist/" regex="solr-clustering-\d.*\.jar" />
-
- <lib dir="../../../contrib/langid/lib/" regex=".*\.jar" />
- <lib dir="../../../dist/" regex="solr-langid-\d.*\.jar" />
-
- <lib dir="../../../contrib/velocity/lib" regex=".*\.jar" />
- <lib dir="../../../dist/" regex="solr-velocity-\d.*\.jar" />
-
- <!-- an exact 'path' can be used instead of a 'dir' to specify a
- specific jar file. This will cause a serious error to be logged
- if it can't be loaded.
- -->
- <!--
- <lib path="../a-jar-that-does-not-exist.jar" />
- -->
-
- <!-- Data Directory
-
- Used to specify an alternate directory to hold all index data
- other than the default ./data under the Solr home. If
- replication is in use, this should match the replication
- configuration.
- -->
- <dataDir>${solr.data.dir:}</dataDir>
-
-
- <!-- The DirectoryFactory to use for indexes.
-
- solr.StandardDirectoryFactory is filesystem
- based and tries to pick the best implementation for the current
- JVM and platform. solr.NRTCachingDirectoryFactory, the default,
- wraps solr.StandardDirectoryFactory and caches small files in memory
- for better NRT performance.
-
- One can force a particular implementation via solr.MMapDirectoryFactory,
- solr.NIOFSDirectoryFactory, or solr.SimpleFSDirectoryFactory.
-
- solr.RAMDirectoryFactory is memory based, not
- persistent, and doesn't work with replication.
- -->
- <directoryFactory name="DirectoryFactory"
- class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}">
-
-
- <!-- These will be used if you are using the solr.HdfsDirectoryFactory,
- otherwise they will be ignored. If you don't plan on using hdfs,
- you can safely remove this section. -->
- <!-- The root directory that collection data should be written to. -->
- <str name="solr.hdfs.home">${solr.hdfs.home:}</str>
- <!-- The hadoop configuration files to use for the hdfs client. -->
- <str name="solr.hdfs.confdir">${solr.hdfs.confdir:}</str>
- <!-- Enable/Disable the hdfs cache. -->
- <str name="solr.hdfs.blockcache.enabled">${solr.hdfs.blockcache.enabled:true}</str>
- <!-- Enable/Disable using one global cache for all SolrCores.
- The settings used will be from the first HdfsDirectoryFactory created. -->
- <str name="solr.hdfs.blockcache.global">${solr.hdfs.blockcache.global:true}</str>
-
- </directoryFactory>
-
- <!-- The CodecFactory for defining the format of the inverted index.
- The default implementation is SchemaCodecFactory, which is the official Lucene
- index format, but hooks into the schema to provide per-field customization of
- the postings lists and per-document values in the fieldType element
- (postingsFormat/docValuesFormat). Note that most of the alternative implementations
- are experimental, so if you choose to customize the index format, its a good
- idea to convert back to the official format e.g. via IndexWriter.addIndexes(IndexReader)
- before upgrading to a newer version to avoid unnecessary reindexing.
- -->
- <codecFactory class="solr.SchemaCodecFactory"/>
-
- <!-- To enable dynamic schema REST APIs, use the following for <schemaFactory>:
-
- <schemaFactory class="ManagedIndexSchemaFactory">
- <bool name="mutable">true</bool>
- <str name="managedSchemaResourceName">managed-schema</str>
- </schemaFactory>
-
- When ManagedIndexSchemaFactory is specified, Solr will load the schema from
- he resource named in 'managedSchemaResourceName', rather than from schema.xml.
- Note that the managed schema resource CANNOT be named schema.xml. If the managed
- schema does not exist, Solr will create it after reading schema.xml, then rename
- 'schema.xml' to 'schema.xml.bak'.
-
- Do NOT hand edit the managed schema - external modifications will be ignored and
- overwritten as a result of schema modification REST API calls.
-
- When ManagedIndexSchemaFactory is specified with mutable = true, schema
- modification REST API calls will be allowed; otherwise, error responses will be
- sent back for these requests.
- -->
- <schemaFactory class="ClassicIndexSchemaFactory"/>
-
- <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Index Config - These settings control low-level behavior of indexing
- Most example settings here show the default value, but are commented
- out, to more easily see where customizations have been made.
-
- Note: This replaces <indexDefaults> and <mainIndex> from older versions
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <indexConfig>
- <!-- maxFieldLength was removed in 4.0. To get similar behavior, include a
- LimitTokenCountFilterFactory in your fieldType definition. E.g.
- <filter class="solr.LimitTokenCountFilterFactory" maxTokenCount="10000"/>
- -->
- <!-- Maximum time to wait for a write lock (ms) for an IndexWriter. Default: 1000 -->
- <!-- <writeLockTimeout>1000</writeLockTimeout> -->
-
- <!-- The maximum number of simultaneous threads that may be
- indexing documents at once in IndexWriter; if more than this
- many threads arrive they will wait for others to finish.
- Default in Solr/Lucene is 8. -->
- <!-- <maxIndexingThreads>8</maxIndexingThreads> -->
-
- <!-- Expert: Enabling compound file will use less files for the index,
- using fewer file descriptors on the expense of performance decrease.
- Default in Lucene is "true". Default in Solr is "false" (since 3.6) -->
- <!-- <useCompoundFile>false</useCompoundFile> -->
-
- <!-- ramBufferSizeMB sets the amount of RAM that may be used by Lucene
- indexing for buffering added documents and deletions before they are
- flushed to the Directory.
- maxBufferedDocs sets a limit on the number of documents buffered
- before flushing.
- If both ramBufferSizeMB and maxBufferedDocs is set, then
- Lucene will flush based on whichever limit is hit first.
- The default is 100 MB. -->
- <!-- <ramBufferSizeMB>100</ramBufferSizeMB> -->
- <!-- <maxBufferedDocs>1000</maxBufferedDocs> -->
-
- <!-- Expert: Merge Policy
- The Merge Policy in Lucene controls how merging of segments is done.
- The default since Solr/Lucene 3.3 is TieredMergePolicy.
- The default since Lucene 2.3 was the LogByteSizeMergePolicy,
- Even older versions of Lucene used LogDocMergePolicy.
- -->
- <!--
- <mergePolicy class="org.apache.lucene.index.TieredMergePolicy">
- <int name="maxMergeAtOnce">10</int>
- <int name="segmentsPerTier">10</int>
- </mergePolicy>
- -->
-
- <!-- Merge Factor
- The merge factor controls how many segments will get merged at a time.
- For TieredMergePolicy, mergeFactor is a convenience parameter which
- will set both MaxMergeAtOnce and SegmentsPerTier at once.
- For LogByteSizeMergePolicy, mergeFactor decides how many new segments
- will be allowed before they are merged into one.
- Default is 10 for both merge policies.
- -->
- <!--
- <mergeFactor>10</mergeFactor>
- -->
-
- <!-- Expert: Merge Scheduler
- The Merge Scheduler in Lucene controls how merges are
- performed. The ConcurrentMergeScheduler (Lucene 2.3 default)
- can perform merges in the background using separate threads.
- The SerialMergeScheduler (Lucene 2.2 default) does not.
- -->
- <!--
- <mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/>
- -->
-
- <!-- LockFactory
-
- This option specifies which Lucene LockFactory implementation
- to use.
-
- single = SingleInstanceLockFactory - suggested for a
- read-only index or when there is no possibility of
- another process trying to modify the index.
- native = NativeFSLockFactory - uses OS native file locking.
- Do not use when multiple solr webapps in the same
- JVM are attempting to share a single index.
- simple = SimpleFSLockFactory - uses a plain file for locking
-
- Defaults: 'native' is default for Solr3.6 and later, otherwise
- 'simple' is the default
-
- More details on the nuances of each LockFactory...
- http://wiki.apache.org/lucene-java/AvailableLockFactories
- -->
- <lockType>${solr.lock.type:native}</lockType>
-
- <!-- Unlock On Startup
-
- If true, unlock any held write or commit locks on startup.
- This defeats the locking mechanism that allows multiple
- processes to safely access a lucene index, and should be used
- with care. Default is "false".
-
- This is not needed if lock type is 'single'
- -->
- <!--
- <unlockOnStartup>false</unlockOnStartup>
- -->
-
- <!-- Expert: Controls how often Lucene loads terms into memory
- Default is 128 and is likely good for most everyone.
- -->
- <!-- <termIndexInterval>128</termIndexInterval> -->
-
- <!-- If true, IndexReaders will be opened/reopened from the IndexWriter
- instead of from the Directory. Hosts in a master/slave setup
- should have this set to false while those in a SolrCloud
- cluster need to be set to true. Default: true
- -->
- <!--
- <nrtMode>true</nrtMode>
- -->
-
- <!-- Commit Deletion Policy
- Custom deletion policies can be specified here. The class must
- implement org.apache.lucene.index.IndexDeletionPolicy.
-
- The default Solr IndexDeletionPolicy implementation supports
- deleting index commit points on number of commits, age of
- commit point and optimized status.
-
- The latest commit point should always be preserved regardless
- of the criteria.
- -->
- <!--
- <deletionPolicy class="solr.SolrDeletionPolicy">
- -->
- <!-- The number of commit points to be kept -->
- <!-- <str name="maxCommitsToKeep">1</str> -->
- <!-- The number of optimized commit points to be kept -->
- <!-- <str name="maxOptimizedCommitsToKeep">0</str> -->
- <!--
- Delete all commit points once they have reached the given age.
- Supports DateMathParser syntax e.g.
- -->
- <!--
- <str name="maxCommitAge">30MINUTES</str>
- <str name="maxCommitAge">1DAY</str>
- -->
- <!--
- </deletionPolicy>
- -->
-
- <!-- Lucene Infostream
-
- To aid in advanced debugging, Lucene provides an "InfoStream"
- of detailed information when indexing.
-
- Setting the value to true will instruct the underlying Lucene
- IndexWriter to write its info stream to solr's log. By default,
- this is enabled here, and controlled through log4j.properties.
- -->
- <infoStream>true</infoStream>
- </indexConfig>
-
-
- <!-- JMX
-
- This example enables JMX if and only if an existing MBeanServer
- is found, use this if you want to configure JMX through JVM
- parameters. Remove this to disable exposing Solr configuration
- and statistics to JMX.
-
- For more details see http://wiki.apache.org/solr/SolrJmx
- -->
- <jmx />
- <!-- If you want to connect to a particular server, specify the
- agentId
- -->
- <!-- <jmx agentId="myAgent" /> -->
- <!-- If you want to start a new MBeanServer, specify the serviceUrl -->
- <!-- <jmx serviceUrl="service:jmx:rmi:///jndi/rmi://localhost:9999/solr"/>
- -->
-
- <!-- The default high-performance update handler -->
- <updateHandler class="solr.DirectUpdateHandler2">
-
- <!-- Enables a transaction log, used for real-time get, durability, and
- and solr cloud replica recovery. The log can grow as big as
- uncommitted changes to the index, so use of a hard autoCommit
- is recommended (see below).
- "dir" - the target directory for transaction logs, defaults to the
- solr data directory. -->
- <updateLog>
- <str name="dir">${solr.ulog.dir:}</str>
- </updateLog>
-
- <!-- AutoCommit
-
- Perform a hard commit automatically under certain conditions.
- Instead of enabling autoCommit, consider using "commitWithin"
- when adding documents.
-
- http://wiki.apache.org/solr/UpdateXmlMessages
-
- maxDocs - Maximum number of documents to add since the last
- commit before automatically triggering a new commit.
-
- maxTime - Maximum amount of time in ms that is allowed to pass
- since a document was added before automatically
- triggering a new commit.
- openSearcher - if false, the commit causes recent index changes
- to be flushed to stable storage, but does not cause a new
- searcher to be opened to make those changes visible.
-
- If the updateLog is enabled, then it's highly recommended to
- have some sort of hard autoCommit to limit the log size.
- -->
- <autoCommit>
- <maxTime>${solr.autoCommit.maxTime:15000}</maxTime>
- <openSearcher>false</openSearcher>
- </autoCommit>
-
- <!-- softAutoCommit is like autoCommit except it causes a
- 'soft' commit which only ensures that changes are visible
- but does not ensure that data is synced to disk. This is
- faster and more near-realtime friendly than a hard commit.
- -->
-
- <autoSoftCommit>
- <maxTime>${solr.autoSoftCommit.maxTime:-1}</maxTime>
- </autoSoftCommit>
-
- <!-- Update Related Event Listeners
-
- Various IndexWriter related events can trigger Listeners to
- take actions.
-
- postCommit - fired after every commit or optimize command
- postOptimize - fired after every optimize command
- -->
- <!-- The RunExecutableListener executes an external command from a
- hook such as postCommit or postOptimize.
-
- exe - the name of the executable to run
- dir - dir to use as the current working directory. (default=".")
- wait - the calling thread waits until the executable returns.
- (default="true")
- args - the arguments to pass to the program. (default is none)
- env - environment variables to set. (default is none)
- -->
- <!-- This example shows how RunExecutableListener could be used
- with the script based replication...
- http://wiki.apache.org/solr/CollectionDistribution
- -->
- <!--
- <listener event="postCommit" class="solr.RunExecutableListener">
- <str name="exe">solr/bin/snapshooter</str>
- <str name="dir">.</str>
- <bool name="wait">true</bool>
- <arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
- <arr name="env"> <str>MYVAR=val1</str> </arr>
- </listener>
- -->
-
- </updateHandler>
-
- <!-- IndexReaderFactory
-
- Use the following format to specify a custom IndexReaderFactory,
- which allows for alternate IndexReader implementations.
-
- ** Experimental Feature **
-
- Please note - Using a custom IndexReaderFactory may prevent
- certain other features from working. The API to
- IndexReaderFactory may change without warning or may even be
- removed from future releases if the problems cannot be
- resolved.
-
-
- ** Features that may not work with custom IndexReaderFactory **
-
- The ReplicationHandler assumes a disk-resident index. Using a
- custom IndexReader implementation may cause incompatibility
- with ReplicationHandler and may cause replication to not work
- correctly. See SOLR-1366 for details.
-
- -->
- <!--
- <indexReaderFactory name="IndexReaderFactory" class="package.class">
- <str name="someArg">Some Value</str>
- </indexReaderFactory >
- -->
- <!-- By explicitly declaring the Factory, the termIndexDivisor can
- be specified.
- -->
- <!--
- <indexReaderFactory name="IndexReaderFactory"
- class="solr.StandardIndexReaderFactory">
- <int name="setTermIndexDivisor">12</int>
- </indexReaderFactory >
- -->
-
- <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Query section - these settings control query time things like caches
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <query>
- <!-- Max Boolean Clauses
-
- Maximum number of clauses in each BooleanQuery, an exception
- is thrown if exceeded.
-
- ** WARNING **
-
- This option actually modifies a global Lucene property that
- will affect all SolrCores. If multiple solrconfig.xml files
- disagree on this property, the value at any given moment will
- be based on the last SolrCore to be initialized.
-
- -->
- <maxBooleanClauses>1024</maxBooleanClauses>
-
-
- <!-- Solr Internal Query Caches
-
- There are two implementations of cache available for Solr,
- LRUCache, based on a synchronized LinkedHashMap, and
- FastLRUCache, based on a ConcurrentHashMap.
-
- FastLRUCache has faster gets and slower puts in single
- threaded operation and thus is generally faster than LRUCache
- when the hit ratio of the cache is high (> 75%), and may be
- faster under other scenarios on multi-cpu systems.
- -->
-
- <!-- Filter Cache
-
- Cache used by SolrIndexSearcher for filters (DocSets),
- unordered sets of *all* documents that match a query. When a
- new searcher is opened, its caches may be prepopulated or
- "autowarmed" using data from caches in the old searcher.
- autowarmCount is the number of items to prepopulate. For
- LRUCache, the autowarmed items will be the most recently
- accessed items.
-
- Parameters:
- class - the SolrCache implementation LRUCache or
- (LRUCache or FastLRUCache)
- size - the maximum number of entries in the cache
- initialSize - the initial capacity (number of entries) of
- the cache. (see java.util.HashMap)
- autowarmCount - the number of entries to prepopulate from
- and old cache.
- -->
- <filterCache class="solr.FastLRUCache"
- size="512"
- initialSize="512"
- autowarmCount="0"/>
-
- <!-- Query Result Cache
-
- Caches results of searches - ordered lists of document ids
- (DocList) based on a query, a sort, and the range of documents requested.
- -->
- <queryResultCache class="solr.LRUCache"
- size="512"
- initialSize="512"
- autowarmCount="0"/>
-
- <!-- Document Cache
-
- Caches Lucene Document objects (the stored fields for each
- document). Since Lucene internal document ids are transient,
- this cache will not be autowarmed.
- -->
- <documentCache class="solr.LRUCache"
- size="512"
- initialSize="512"
- autowarmCount="0"/>
-
- <!-- custom cache currently used by block join -->
- <cache name="perSegFilter"
- class="solr.search.LRUCache"
- size="10"
- initialSize="0"
- autowarmCount="10"
- regenerator="solr.NoOpRegenerator" />
-
- <!-- Field Value Cache
-
- Cache used to hold field values that are quickly accessible
- by document id. The fieldValueCache is created by default
- even if not configured here.
- -->
- <!--
- <fieldValueCache class="solr.FastLRUCache"
- size="512"
- autowarmCount="128"
- showItems="32" />
- -->
-
- <!-- Custom Cache
-
- Example of a generic cache. These caches may be accessed by
- name through SolrIndexSearcher.getCache(),cacheLookup(), and
- cacheInsert(). The purpose is to enable easy caching of
- user/application level data. The regenerator argument should
- be specified as an implementation of solr.CacheRegenerator
- if autowarming is desired.
- -->
- <!--
- <cache name="myUserCache"
- class="solr.LRUCache"
- size="4096"
- initialSize="1024"
- autowarmCount="1024"
- regenerator="com.mycompany.MyRegenerator"
- />
- -->
-
-
- <!-- Lazy Field Loading
-
- If true, stored fields that are not requested will be loaded
- lazily. This can result in a significant speed improvement
- if the usual case is to not load all stored fields,
- especially if the skipped fields are large compressed text
- fields.
- -->
- <enableLazyFieldLoading>true</enableLazyFieldLoading>
-
- <!-- Use Filter For Sorted Query
-
- A possible optimization that attempts to use a filter to
- satisfy a search. If the requested sort does not include
- score, then the filterCache will be checked for a filter
- matching the query. If found, the filter will be used as the
- source of document ids, and then the sort will be applied to
- that.
-
- For most situations, this will not be useful unless you
- frequently get the same search repeatedly with different sort
- options, and none of them ever use "score"
- -->
- <!--
- <useFilterForSortedQuery>true</useFilterForSortedQuery>
- -->
-
- <!-- Result Window Size
-
- An optimization for use with the queryResultCache. When a search
- is requested, a superset of the requested number of document ids
- are collected. For example, if a search for a particular query
- requests matching documents 10 through 19, and queryWindowSize is 50,
- then documents 0 through 49 will be collected and cached. Any further
- requests in that range can be satisfied via the cache.
- -->
- <queryResultWindowSize>20</queryResultWindowSize>
-
- <!-- Maximum number of documents to cache for any entry in the
- queryResultCache.
- -->
- <queryResultMaxDocsCached>200</queryResultMaxDocsCached>
-
- <!-- Query Related Event Listeners
-
- Various IndexSearcher related events can trigger Listeners to
- take actions.
-
- newSearcher - fired whenever a new searcher is being prepared
- and there is a current searcher handling requests (aka
- registered). It can be used to prime certain caches to
- prevent long request times for certain requests.
-
- firstSearcher - fired whenever a new searcher is being
- prepared but there is no current registered searcher to handle
- requests or to gain autowarming data from.
-
-
- -->
- <!-- QuerySenderListener takes an array of NamedList and executes a
- local query request for each NamedList in sequence.
- -->
- <listener event="newSearcher" class="solr.QuerySenderListener">
- <arr name="queries">
- <!--
- <lst><str name="q">solr</str><str name="sort">price asc</str></lst>
- <lst><str name="q">rocks</str><str name="sort">weight asc</str></lst>
- -->
- </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>
-
- <!-- Use Cold Searcher
-
- If a search request comes in and there is no current
- registered searcher, then immediately register the still
- warming searcher and use it. If "false" then all requests
- will block until the first searcher is done warming.
- -->
- <useColdSearcher>false</useColdSearcher>
-
- <!-- Max Warming Searchers
-
- Maximum number of searchers that may be warming in the
- background concurrently. An error is returned if this limit
- is exceeded.
-
- Recommend values of 1-2 for read-only slaves, higher for
- masters w/o cache warming.
- -->
- <maxWarmingSearchers>2</maxWarmingSearchers>
-
- </query>
-
-
- <!-- Request Dispatcher
-
- This section contains instructions for how the SolrDispatchFilter
- should behave when processing requests for this SolrCore.
-
- handleSelect is a legacy option that affects the behavior of requests
- such as /select?qt=XXX
-
- handleSelect="true" will cause the SolrDispatchFilter to process
- the request and dispatch the query to a handler specified by the
- "qt" param, assuming "/select" isn't already registered.
-
- handleSelect="false" will cause the SolrDispatchFilter to
- ignore "/select" requests, resulting in a 404 unless a handler
- is explicitly registered with the name "/select"
-
- handleSelect="true" is not recommended for new users, but is the default
- for backwards compatibility
- -->
- <requestDispatcher handleSelect="false" >
- <!-- Request Parsing
-
- These settings indicate how Solr Requests may be parsed, and
- what restrictions may be placed on the ContentStreams from
- those requests
-
- enableRemoteStreaming - enables use of the stream.file
- and stream.url parameters for specifying remote streams.
-
- multipartUploadLimitInKB - specifies the max size (in KiB) of
- Multipart File Uploads that Solr will allow in a Request.
-
- formdataUploadLimitInKB - specifies the max size (in KiB) of
- form data (application/x-www-form-urlencoded) sent via
- POST. You can use POST to pass request parameters not
- fitting into the URL.
-
- addHttpRequestToContext - if set to true, it will instruct
- the requestParsers to include the original HttpServletRequest
- object in the context map of the SolrQueryRequest under the
- key "httpRequest". It will not be used by any of the existing
- Solr components, but may be useful when developing custom
- plugins.
-
- *** WARNING ***
- The settings below authorize Solr to fetch remote files, You
- should make sure your system has some authentication before
- using enableRemoteStreaming="true"
-
- -->
- <requestParsers enableRemoteStreaming="true"
- multipartUploadLimitInKB="2048000"
- formdataUploadLimitInKB="2048"
- addHttpRequestToContext="false"/>
-
- <!-- HTTP Caching
-
- Set HTTP caching related parameters (for proxy caches and clients).
-
- The options below instruct Solr not to output any HTTP Caching
- related headers
- -->
- <httpCaching never304="true" />
- <!-- If you include a <cacheControl> directive, it will be used to
- generate a Cache-Control header (as well as an Expires header
- if the value contains "max-age=")
-
- By default, no Cache-Control header is generated.
-
- You can use the <cacheControl> option even if you have set
- never304="true"
- -->
- <!--
- <httpCaching never304="true" >
- <cacheControl>max-age=30, public</cacheControl>
- </httpCaching>
- -->
- <!-- To enable Solr to respond with automatically generated HTTP
- Caching headers, and to response to Cache Validation requests
- correctly, set the value of never304="false"
-
- This will cause Solr to generate Last-Modified and ETag
- headers based on the properties of the Index.
-
- The following options can also be specified to affect the
- values of these headers...
-
- lastModFrom - the default value is "openTime" which means the
- Last-Modified value (and validation against If-Modified-Since
- requests) will all be relative to when the current Searcher
- was opened. You can change it to lastModFrom="dirLastMod" if
- you want the value to exactly correspond to when the physical
- index was last modified.
-
- etagSeed="..." is an option you can change to force the ETag
- header (and validation against If-None-Match requests) to be
- different even if the index has not changed (ie: when making
- significant changes to your config file)
-
- (lastModifiedFrom and etagSeed are both ignored if you use
- the never304="true" option)
- -->
- <!--
- <httpCaching lastModifiedFrom="openTime"
- etagSeed="Solr">
- <cacheControl>max-age=30, public</cacheControl>
- </httpCaching>
- -->
- </requestDispatcher>
-
- <!-- Request Handlers
-
- http://wiki.apache.org/solr/SolrRequestHandler
-
- Incoming queries will be dispatched to a specific handler by name
- based on the path specified in the request.
-
- Legacy behavior: If the request path uses "/select" but no Request
- Handler has that name, and if handleSelect="true" has been specified in
- the requestDispatcher, then the Request Handler is dispatched based on
- the qt parameter. Handlers without a leading '/' are accessed this way
- like so: http://host/app/[core/]select?qt=name If no qt is
- given, then the requestHandler that declares default="true" will be
- used or the one named "standard".
-
- If a Request Handler is declared with startup="lazy", then it will
- not be initialized until the first request that uses it.
-
- -->
- <!-- SearchHandler
-
- http://wiki.apache.org/solr/SearchHandler
-
- For processing Search Queries, the primary Request Handler
- provided with Solr is "SearchHandler" It delegates to a sequent
- of SearchComponents (see below) and supports distributed
- queries across multiple shards
- -->
- <requestHandler name="/select" class="solr.SearchHandler">
- <!-- default values for query parameters can be specified, these
- will be overridden by parameters in the request
- -->
- <lst name="defaults">
- <str name="echoParams">explicit</str>
- <int name="rows">10</int>
- <str name="df">text</str>
- </lst>
- <!-- In addition to defaults, "appends" params can be specified
- to identify values which should be appended to the list of
- multi-val params from the query (or the existing "defaults").
- -->
- <!-- In this example, the param "fq=instock:true" would be appended to
- any query time fq params the user may specify, as a mechanism for
- partitioning the index, independent of any user selected filtering
- that may also be desired (perhaps as a result of faceted searching).
-
- NOTE: there is *absolutely* nothing a client can do to prevent these
- "appends" values from being used, so don't use this mechanism
- unless you are sure you always want it.
- -->
- <!--
- <lst name="appends">
- <str name="fq">inStock:true</str>
- </lst>
- -->
- <!-- "invariants" are a way of letting the Solr maintainer lock down
- the options available to Solr clients. Any params values
- specified here are used regardless of what values may be specified
- in either the query, the "defaults", or the "appends" params.
-
- In this example, the facet.field and facet.query params would
- be fixed, limiting the facets clients can use. Faceting is
- not turned on by default - but if the client does specify
- facet=true in the request, these are the only facets they
- will be able to see counts for; regardless of what other
- facet.field or facet.query params they may specify.
-
- NOTE: there is *absolutely* nothing a client can do to prevent these
- "invariants" values from being used, so don't use this mechanism
- unless you are sure you always want it.
- -->
- <!--
- <lst name="invariants">
- <str name="facet.field">cat</str>
- <str name="facet.field">manu_exact</str>
- <str name="facet.query">price:[* TO 500]</str>
- <str name="facet.query">price:[500 TO *]</str>
- </lst>
- -->
- <!-- If the default list of SearchComponents is not desired, that
- list can either be overridden completely, or components can be
- prepended or appended to the default list. (see below)
- -->
- <!--
- <arr name="components">
- <str>nameOfCustomComponent1</str>
- <str>nameOfCustomComponent2</str>
- </arr>
- -->
- </requestHandler>
-
- <!-- A request handler that returns indented JSON by default -->
- <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">text</str>
- </lst>
- </requestHandler>
-
-
- <!-- realtime get handler, guaranteed to return the latest stored fields of
- any document, without the need to commit or open a new searcher. The
- current implementation relies on the updateLog feature being enabled.
-
- ** WARNING **
- Do NOT disable the realtime get handler at /get if you are using
- SolrCloud otherwise any leader election will cause a full sync in ALL
- replicas for the shard in question. Similarly, a replica recovery will
- also always fetch the complete index from the leader because a partial
- sync will not be possible in the absence of this handler.
- -->
- <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>
-
-
- <!-- A Robust Example
-
- This example SearchHandler declaration shows off usage of the
- SearchHandler with many defaults declared
-
- Note that multiple instances of the same Request Handler
- (SearchHandler) can be registered multiple times with different
- names (and different init parameters)
- -->
- <requestHandler name="/browse" class="solr.SearchHandler">
- <lst name="defaults">
- <str name="echoParams">explicit</str>
-
- <!-- VelocityResponseWriter settings -->
- <str name="wt">velocity</str>
- <str name="v.template">browse</str>
- <str name="v.layout">layout</str>
- <str name="title">Solritas</str>
-
- <!-- Query settings -->
- <str name="defType">edismax</str>
- <str name="qf">
- text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
- title^10.0 description^5.0 keywords^5.0 author^2.0 resourcename^1.0
- </str>
- <str name="df">text</str>
- <str name="mm">100%</str>
- <str name="q.alt">*:*</str>
- <str name="rows">10</str>
- <str name="fl">*,score</str>
-
- <str name="mlt.qf">
- text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
- title^10.0 description^5.0 keywords^5.0 author^2.0 resourcename^1.0
- </str>
- <str name="mlt.fl">text,features,name,sku,id,manu,cat,title,description,keywords,author,resourcename</str>
- <int name="mlt.count">3</int>
-
- <!-- Faceting defaults -->
- <str name="facet">on</str>
- <str name="facet.field">cat</str>
- <str name="facet.field">manu_exact</str>
- <str name="facet.field">content_type</str>
- <str name="facet.field">author_s</str>
- <str name="facet.query">ipod</str>
- <str name="facet.query">GB</str>
- <str name="facet.mincount">1</str>
- <str name="facet.pivot">cat,inStock</str>
- <str name="facet.range.other">after</str>
- <str name="facet.range">price</str>
- <int name="f.price.facet.range.start">0</int>
- <int name="f.price.facet.range.end">600</int>
- <int name="f.price.facet.range.gap">50</int>
- <str name="facet.range">popularity</str>
- <int name="f.popularity.facet.range.start">0</int>
- <int name="f.popularity.facet.range.end">10</int>
- <int name="f.popularity.facet.range.gap">3</int>
- <str name="facet.range">manufacturedate_dt</str>
- <str name="f.manufacturedate_dt.facet.range.start">NOW/YEAR-10YEARS</str>
- <str name="f.manufacturedate_dt.facet.range.end">NOW</str>
- <str name="f.manufacturedate_dt.facet.range.gap">+1YEAR</str>
- <str name="f.manufacturedate_dt.facet.range.other">before</str>
- <str name="f.manufacturedate_dt.facet.range.other">after</str>
-
- <!-- Highlighting defaults -->
- <str name="hl">on</str>
- <str name="hl.fl">content features title name</str>
- <str name="hl.encoder">html</str>
- <str name="hl.simple.pre"><b></str>
- <str name="hl.simple.post"></b></str>
- <str name="f.title.hl.fragsize">0</str>
- <str name="f.title.hl.alternateField">title</str>
- <str name="f.name.hl.fragsize">0</str>
- <str name="f.name.hl.alternateField">name</str>
- <str name="f.content.hl.snippets">3</str>
- <str name="f.content.hl.fragsize">200</str>
- <str name="f.content.hl.alternateField">content</str>
- <str name="f.content.hl.maxAlternateFieldLength">750</str>
-
- <!-- Spell checking defaults -->
- <str name="spellcheck">on</str>
- <str name="spellcheck.extendedResults">false</str>
- <str name="spellcheck.count">5</str>
- <str name="spellcheck.alternativeTermCount">2</str>
- <str name="spellcheck.maxResultsForSuggest">5</str>
- <str name="spellcheck.collate">true</str>
- <str name="spellcheck.collateExtendedResults">true</str>
- <str name="spellcheck.maxCollationTries">5</str>
- <str name="spellcheck.maxCollations">3</str>
- </lst>
-
- <!-- append spellchecking to our list of components -->
- <arr name="last-components">
- <str>spellcheck</str>
- </arr>
- </requestHandler>
-
-
- <!-- Update Request Handler.
-
- http://wiki.apache.org/solr/UpdateXmlMessages
-
- The canonical Request Handler for Modifying the Index through
- commands specified using XML, JSON, CSV, or JAVABIN
-
- Note: Since solr1.1 requestHandlers requires a valid content
- type header if posted in the body. For example, curl now
- requires: -H 'Content-type:text/xml; charset=utf-8'
-
- To override the request content type and force a specific
- Content-type, use the request parameter:
- ?update.contentType=text/csv
-
- This handler will pick a response format to match the input
- if the 'wt' parameter is not explicit
- -->
- <requestHandler name="/update" class="solr.UpdateRequestHandler">
- <!-- See below for information on defining
- updateRequestProcessorChains that can be used by name
- on each Update Request
- -->
- <!--
- <lst name="defaults">
- <str name="update.chain">dedupe</str>
- </lst>
- -->
- </requestHandler>
-
- <!-- for back compat with clients using /update/json and /update/csv -->
- <requestHandler name="/update/json" class="solr.UpdateRequestHandler">
- <lst name="defaults">
- <str name="stream.contentType">application/json</str>
- </lst>
- </requestHandler>
- <requestHandler name="/update/csv" class="solr.UpdateRequestHandler">
- <lst name="defaults">
- <str name="stream.contentType">application/csv</str>
- </lst>
- </requestHandler>
-
- <!-- Solr Cell Update Request Handler
-
- http://wiki.apache.org/solr/ExtractingRequestHandler
-
- -->
- <requestHandler name="/update/extract"
- startup="lazy"
- class="solr.extraction.ExtractingRequestHandler" >
- <lst name="defaults">
- <str name="lowernames">true</str>
- <str name="uprefix">ignored_</str>
-
- <!-- capture link hrefs but ignore div attributes -->
- <str name="captureAttr">true</str>
- <str name="fmap.a">links</str>
- <str name="fmap.div">ignored_</str>
- </lst>
- </requestHandler>
-
-
- <!-- Field Analysis Request Handler
-
- RequestHandler that provides much the same functionality as
- analysis.jsp. Provides the ability to specify multiple field
- types and field names in the same request and outputs
- index-time and query-time analysis for each of them.
-
- Request parameters are:
- analysis.fieldname - field name whose analyzers are to be used
-
- analysis.fieldtype - field type whose analyzers are to be used
- analysis.fieldvalue - text for index-time analysis
- q (or analysis.q) - text for query time analysis
- analysis.showmatch (true|false) - When set to true and when
- query analysis is performed, the produced tokens of the
- field value analysis will be marked as "matched" for every
- token that is produces by the query analysis
- -->
- <requestHandler name="/analysis/field"
- startup="lazy"
- class="solr.FieldAnalysisRequestHandler" />
-
-
- <!-- Document Analysis Handler
-
- http://wiki.apache.org/solr/AnalysisRequestHandler
-
- An analysis handler that provides a breakdown of the analysis
- process of provided documents. This handler expects a (single)
- content stream with the following format:
-
- <docs>
- <doc>
- <field name="id">1</field>
- <field name="name">The Name</field>
- <field name="text">The Text Value</field>
- </doc>
- <doc>...</doc>
- <doc>...</doc>
- ...
- </docs>
-
- Note: Each document must contain a field which serves as the
- unique key. This key is used in the returned response to associate
- an analysis breakdown to the analyzed document.
-
- Like the FieldAnalysisRequestHandler, this handler also supports
- query analysis by sending either an "analysis.query" or "q"
- request parameter that holds the query text to be analyzed. It
- also supports the "analysis.showmatch" parameter which when set to
- true, all field tokens that match the query tokens will be marked
- as a "match".
- -->
- <requestHandler name="/analysis/document"
- class="solr.DocumentAnalysisRequestHandler"
- startup="lazy" />
-
- <!-- Admin Handlers
-
- Admin Handlers - This will register all the standard admin
- RequestHandlers.
- -->
- <requestHandler name="/admin/"
- class="solr.admin.AdminHandlers" />
- <!-- This single handler is equivalent to the following... -->
- <!--
- <requestHandler name="/admin/luke" class="solr.admin.LukeRequestHandler" />
- <requestHandler name="/admin/system" class="solr.admin.SystemInfoHandler" />
- <requestHandler name="/admin/plugins" class="solr.admin.PluginInfoHandler" />
- <requestHandler name="/admin/threads" class="solr.admin.ThreadDumpHandler" />
- <requestHandler name="/admin/properties" class="solr.admin.PropertiesRequestHandler" />
- <requestHandler name="/admin/file" class="solr.admin.ShowFileRequestHandler" >
- -->
- <!-- If you wish to hide files under ${solr.home}/conf, explicitly
- register the ShowFileRequestHandler using the definition below.
- NOTE: The glob pattern ('*') is the only pattern supported at present, *.xml will
- not exclude all files ending in '.xml'. Use it to exclude _all_ updates
- -->
- <!--
- <requestHandler name="/admin/file"
- class="solr.admin.ShowFileRequestHandler" >
- <lst name="invariants">
- <str name="hidden">synonyms.txt</str>
- <str name="hidden">anotherfile.txt</str>
- <str name="hidden">*</str>
- </lst>
- </requestHandler>
- -->
-
- <!-- ping/healthcheck -->
- <requestHandler name="/admin/ping" class="solr.PingRequestHandler">
- <lst name="invariants">
- <str name="q">solrpingquery</str>
- </lst>
- <lst name="defaults">
- <str name="echoParams">all</str>
- </lst>
- <!-- An optional feature of the PingRequestHandler is to configure the
- handler with a "healthcheckFile" which can be used to enable/disable
- the PingRequestHandler.
- relative paths are resolved against the data dir
- -->
- <!-- <str name="healthcheckFile">server-enabled.txt</str> -->
- </requestHandler>
-
- <!-- Echo the request contents back to the client -->
- <requestHandler name="/debug/dump" class="solr.DumpRequestHandler" >
- <lst name="defaults">
- <str name="echoParams">explicit</str>
- <str name="echoHandler">true</str>
- </lst>
- </requestHandler>
-
- <!-- Solr Replication
-
- The SolrReplicationHandler supports replicating indexes from a
- "master" used for indexing and "slaves" used for queries.
-
- http://wiki.apache.org/solr/SolrReplication
-
- It is also necessary for SolrCloud to function (in Cloud mode, the
- replication handler is used to bulk transfer segments when nodes
- are added or need to recover).
-
- https://wiki.apache.org/solr/SolrCloud/
- -->
- <requestHandler name="/replication" class="solr.ReplicationHandler" >
- <!--
- To enable simple master/slave replication, uncomment one of the
- sections below, depending on whether this solr instance should be
- the "master" or a "slave". If this instance is a "slave" you will
- also need to fill in the masterUrl to point to a real machine.
- -->
- <!--
- <lst name="master">
- <str name="replicateAfter">commit</str>
- <str name="replicateAfter">startup</str>
- <str name="confFiles">schema.xml,stopwords.txt</str>
- </lst>
- -->
- <!--
- <lst name="slave">
- <str name="masterUrl">http://your-master-hostname:8983/solr</str>
- <str name="pollInterval">00:00:60</str>
- </lst>
- -->
- </requestHandler>
-
- <!-- Search Components
-
- Search components are registered to SolrCore and used by
- instances of SearchHandler (which can access them by name)
-
- By default, the following components are available:
-
- <searchComponent name="query" class="solr.QueryComponent" />
- <searchComponent name="facet" class="solr.FacetComponent" />
- <searchComponent name="mlt" class="solr.MoreLikeThisComponent" />
- <searchComponent name="highlight" class="solr.HighlightComponent" />
- <searchComponent name="stats" class="solr.StatsComponent" />
- <searchComponent name="debug" class="solr.DebugComponent" />
-
- Default configuration in a requestHandler would look like:
-
- <arr name="components">
- <str>query</str>
- <str>facet</str>
- <str>mlt</str>
- <str>highlight</str>
- <str>stats</str>
- <str>debug</str>
- </arr>
-
- If you register a searchComponent to one of the standard names,
- that will be used instead of the default.
-
- To insert components before or after the 'standard' components, use:
-
- <arr name="first-components">
- <str>myFirstComponentName</str>
- </arr>
-
- <arr name="last-components">
- <str>myLastComponentName</str>
- </arr>
-
- NOTE: The component registered with the name "debug" will
- always be executed after the "last-components"
-
- -->
-
- <!-- Spell Check
-
- The spell check component can return a list of alternative spelling
- suggestions.
-
- http://wiki.apache.org/solr/SpellCheckComponent
- -->
- <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
-
- <str name="queryAnalyzerFieldType">text_general</str>
-
- <!-- Multiple "Spell Checkers" can be declared and used by this
- component
- -->
-
- <!-- a spellchecker built from a field of the main index -->
- <lst name="spellchecker">
- <str name="name">default</str>
- <str name="field">text</str>
- <str name="classname">solr.DirectSolrSpellChecker</str>
- <!-- the spellcheck distance measure used, the default is the internal levenshtein -->
- <str name="distanceMeasure">internal</str>
- <!-- minimum accuracy needed to be considered a valid spellcheck suggestion -->
- <float name="accuracy">0.5</float>
- <!-- the maximum #edits we consider when enumerating terms: can be 1 or 2 -->
- <int name="maxEdits">2</int>
- <!-- the minimum shared prefix when enumerating terms -->
- <int name="minPrefix">1</int>
- <!-- maximum number of inspections per result. -->
- <int name="maxInspections">5</int>
- <!-- minimum length of a query term to be considered for correction -->
- <int name="minQueryLength">4</int>
- <!-- maximum threshold of documents a query term can appear to be considered for correction -->
- <float name="maxQueryFrequency">0.01</float>
- <!-- uncomment this to require suggestions to occur in 1% of the documents
- <float name="thresholdTokenFrequency">.01</float>
- -->
- </lst>
-
- <!-- a spellchecker that can break or combine words. See "/spell" handler below for usage -->
- <lst name="spellchecker">
- <str name="name">wordbreak</str>
- <str name="classname">solr.WordBreakSolrSpellChecker</str>
- <str name="field">name</str>
- <str name="combineWords">true</str>
- <str name="breakWords">true</str>
- <int name="maxChanges">10</int>
- </lst>
-
- <!-- a spellchecker that uses a different distance measure -->
- <!--
- <lst name="spellchecker">
- <str name="name">jarowinkler</str>
- <str name="field">spell</str>
- <str name="classname">solr.DirectSolrSpellChecker</str>
- <str name="distanceMeasure">
- org.apache.lucene.search.spell.JaroWinklerDistance
- </str>
- </lst>
- -->
-
- <!-- a spellchecker that use an alternate comparator
-
- comparatorClass be one of:
- 1. score (default)
- 2. freq (Frequency first, then score)
- 3. A fully qualified class name
- -->
- <!--
- <lst name="spellchecker">
- <str name="name">freq</str>
- <str name="field">lowerfilt</str>
- <str name="classname">solr.DirectSolrSpellChecker</str>
- <str name="comparatorClass">freq</str>
- -->
-
- <!-- A spellchecker that reads the list of words from a file -->
- <!--
- <lst name="spellchecker">
- <str name="classname">solr.FileBasedSpellChecker</str>
- <str name="name">file</str>
- <str name="sourceLocation">spellings.txt</str>
- <str name="characterEncoding">UTF-8</str>
- <str name="spellcheckIndexDir">spellcheckerFile</str>
- </lst>
- -->
- </searchComponent>
-
- <!-- A request handler for demonstrating the spellcheck component.
-
- NOTE: This is purely as an example. The whole purpose of the
- SpellCheckComponent is to hook it into the request handler that
- handles your normal user queries so that a separate request is
- not needed to get suggestions.
-
- IN OTHER WORDS, THERE IS REALLY GOOD CHANCE THE SETUP BELOW IS
- NOT WHAT YOU WANT FOR YOUR PRODUCTION SYSTEM!
-
- See http://wiki.apache.org/solr/SpellCheckComponent for details
- on the request parameters.
- -->
- <requestHandler name="/spell" class="solr.SearchHandler" startup="lazy">
- <lst name="defaults">
- <str name="df">text</str>
- <!-- Solr will use suggestions from both the 'default' spellchecker
- and from the 'wordbreak' spellchecker and combine them.
- collations (re-written queries) can include a combination of
- corrections from both spellcheckers -->
- <str name="spellcheck.dictionary">default</str>
- <str name="spellcheck.dictionary">wordbreak</str>
- <str name="spellcheck">on</str>
- <str name="spellcheck.extendedResults">true</str>
- <str name="spellcheck.count">10</str>
- <str name="spellcheck.alternativeTermCount">5</str>
- <str name="spellcheck.maxResultsForSuggest">5</str>
- <str name="spellcheck.collate">true</str>
- <str name="spellcheck.collateExtendedResults">true</str>
- <str name="spellcheck.maxCollationTries">10</str>
- <str name="spellcheck.maxCollations">5</str>
- </lst>
- <arr name="last-components">
- <str>spellcheck</str>
- </arr>
- </requestHandler>
-
- <searchComponent name="suggest" class="solr.SuggestComponent">
- <lst name="suggester">
- <str name="name">mySuggester</str>
- <str name="lookupImpl">FuzzyLookupFactory</str> <!-- org.apache.solr.spelling.suggest.fst -->
- <str name="dictionaryImpl">DocumentDictionaryFactory</str> <!-- org.apache.solr.spelling.suggest.HighFrequencyDictionaryFactory -->
- <str name="field">cat</str>
- <str name="weightField">price</str>
- <str name="suggestAnalyzerFieldType">string</str>
- </lst>
- </searchComponent>
-
- <requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy">
- <lst name="defaults">
- <str name="suggest">true</str>
- <str name="suggest.count">10</str>
- </lst>
- <arr name="components">
- <str>suggest</str>
- </arr>
- </requestHandler>
- <!-- Term Vector Component
-
- http://wiki.apache.org/solr/TermVectorComponent
- -->
- <searchComponent name="tvComponent" class="solr.TermVectorComponent"/>
-
- <!-- A request handler for demonstrating the term vector component
-
- This is purely as an example.
-
- In reality you will likely want to add the component to your
- already specified request handlers.
- -->
- <requestHandler name="/tvrh" class="solr.SearchHandler" startup="lazy">
- <lst name="defaults">
- <str name="df">text</str>
- <bool name="tv">true</bool>
- </lst>
- <arr name="last-components">
- <str>tvComponent</str>
- </arr>
- </requestHandler>
-
- <!-- Clustering Component
-
- You'll need to set the solr.clustering.enabled system property
- when running solr to run with clustering enabled:
-
- java -Dsolr.clustering.enabled=true -jar start.jar
-
- http://wiki.apache.org/solr/ClusteringComponent
- http://carrot2.github.io/solr-integration-strategies/
- -->
- <searchComponent name="clustering"
- enable="${solr.clustering.enabled:false}"
- class="solr.clustering.ClusteringComponent" >
- <lst name="engine">
- <str name="name">lingo</str>
-
- <!-- Class name of a clustering algorithm compatible with the Carrot2 framework.
-
- Currently available open source algorithms are:
- * org.carrot2.clustering.lingo.LingoClusteringAlgorithm
- * org.carrot2.clustering.stc.STCClusteringAlgorithm
- * org.carrot2.clustering.kmeans.BisectingKMeansClusteringAlgorithm
-
- See http://project.carrot2.org/algorithms.html for more information.
-
- A commercial algorithm Lingo3G (needs to be installed separately) is defined as:
- * com.carrotsearch.lingo3g.Lingo3GClusteringAlgorithm
- -->
- <str name="carrot.algorithm">org.carrot2.clustering.lingo.LingoClusteringAlgorithm</str>
-
- <!-- Override location of the clustering algorithm's resources
- (attribute definitions and lexical resources).
-
- A directory from which to load algorithm-specific stop words,
- stop labels and attribute definition XMLs.
-
- For an overview of Carrot2 lexical resources, see:
- http://download.carrot2.org/head/manual/#chapter.lexical-resources
-
- For an overview of Lingo3G lexical resources, see:
- http://download.carrotsearch.com/lingo3g/manual/#chapter.lexical-resources
- -->
- <str name="carrot.resourcesDir">clustering/carrot2</str>
- </lst>
-
- <!-- An example definition for the STC clustering algorithm. -->
- <lst name="engine">
- <str name="name">stc</str>
- <str name="carrot.algorithm">org.carrot2.clustering.stc.STCClusteringAlgorithm</str>
- </lst>
-
- <!-- An example definition for the bisecting kmeans clustering algorithm. -->
- <lst name="engine">
- <str name="name">kmeans</str>
- <str name="carrot.algorithm">org.carrot2.clustering.kmeans.BisectingKMeansClusteringAlgorithm</str>
- </lst>
- </searchComponent>
-
- <!-- A request handler for demonstrating the clustering component
-
- This is purely as an example.
-
- In reality you will likely want to add the component to your
- already specified request handlers.
- -->
- <requestHandler name="/clustering"
- startup="lazy"
- enable="${solr.clustering.enabled:false}"
- class="solr.SearchHandler">
- <lst name="defaults">
- <bool name="clustering">true</bool>
- <bool name="clustering.results">true</bool>
- <!-- Field name with the logical "title" of a each document (optional) -->
- <str name="carrot.title">name</str>
- <!-- Field name with the logical "URL" of a each document (optional) -->
- <str name="carrot.url">id</str>
- <!-- Field name with the logical "content" of a each document (optional) -->
- <str name="carrot.snippet">features</str>
- <!-- Apply highlighter to the title/ content and use this for clustering. -->
- <bool name="carrot.produceSummary">true</bool>
- <!-- the maximum number of labels per cluster -->
- <!--<int name="carrot.numDescriptions">5</int>-->
- <!-- produce sub clusters -->
- <bool name="carrot.outputSubClusters">false</bool>
-
- <!-- Configure the remaining request handler parameters. -->
- <str name="defType">edismax</str>
- <str name="qf">
- text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
- </str>
- <str name="q.alt">*:*</str>
- <str name="rows">10</str>
- <str name="fl">*,score</str>
- </lst>
- <arr name="last-components">
- <str>clustering</str>
- </arr>
- </requestHandler>
-
- <!-- Terms Component
-
- http://wiki.apache.org/solr/TermsComponent
-
- A component to return terms and document frequency of those
- terms
- -->
- <searchComponent name="terms" class="solr.TermsComponent"/>
-
- <!-- A request handler for demonstrating the terms component -->
- <requestHandler name="/terms" class="solr.SearchHandler" startup="lazy">
- <lst name="defaults">
- <bool name="terms">true</bool>
- <bool name="distrib">false</bool>
- </lst>
- <arr name="components">
- <str>terms</str>
- </arr>
- </requestHandler>
-
-
- <!-- Query Elevation Component
-
- http://wiki.apache.org/solr/QueryElevationComponent
-
- a search component that enables you to configure the top
- results for a given query regardless of the normal lucene
- scoring.
- -->
- <searchComponent name="elevator" class="solr.QueryElevationComponent" >
- <!-- pick a fieldType to analyze queries -->
- <str name="queryFieldType">string</str>
- <str name="config-file">elevate.xml</str>
- </searchComponent>
-
- <!-- A request handler for demonstrating the elevator component -->
- <requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy">
- <lst name="defaults">
- <str name="echoParams">explicit</str>
- <str name="df">text</str>
- </lst>
- <arr name="last-components">
- <str>elevator</str>
- </arr>
- </requestHandler>
-
- <!-- Highlighting Component
-
- http://wiki.apache.org/solr/HighlightingParameters
- -->
- <searchComponent class="solr.HighlightComponent" name="highlight">
- <highlighting>
- <!-- Configure the standard fragmenter -->
- <!-- This could most likely be commented out in the "default" case -->
- <fragmenter name="gap"
- default="true"
- class="solr.highlight.GapFragmenter">
- <lst name="defaults">
- <int name="hl.fragsize">100</int>
- </lst>
- </fragmenter>
-
- <!-- A regular-expression-based fragmenter
- (for sentence extraction)
- -->
- <fragmenter name="regex"
- class="solr.highlight.RegexFragmenter">
- <lst name="defaults">
- <!-- slightly smaller fragsizes work better because of slop -->
- <int name="hl.fragsize">70</int>
- <!-- allow 50% slop on fragment sizes -->
- <float name="hl.regex.slop">0.5</float>
- <!-- a basic sentence pattern -->
- <str name="hl.regex.pattern">[-\w ,/\n\"']{20,200}</str>
- </lst>
- </fragmenter>
-
- <!-- Configure the standard formatter -->
- <formatter name="html"
- default="true"
- class="solr.highlight.HtmlFormatter">
- <lst name="defaults">
- <str name="hl.simple.pre"><![CDATA[<em>]]></str>
- <str name="hl.simple.post"><![CDATA[</em>]]></str>
- </lst>
- </formatter>
-
- <!-- Configure the standard encoder -->
- <encoder name="html"
- class="solr.highlight.HtmlEncoder" />
-
- <!-- Configure the standard fragListBuilder -->
- <fragListBuilder name="simple"
- class="solr.highlight.SimpleFragListBuilder"/>
-
- <!-- Configure the single fragListBuilder -->
- <fragListBuilder name="single"
- class="solr.highlight.SingleFragListBuilder"/>
-
- <!-- Configure the weighted fragListBuilder -->
- <fragListBuilder name="weighted"
- default="true"
- class="solr.highlight.WeightedFragListBuilder"/>
-
- <!-- default tag FragmentsBuilder -->
- <fragmentsBuilder name="default"
- default="true"
- class="solr.highlight.ScoreOrderFragmentsBuilder">
- <!--
- <lst name="defaults">
- <str name="hl.multiValuedSeparatorChar">/</str>
- </lst>
- -->
- </fragmentsBuilder>
-
- <!-- multi-colored tag FragmentsBuilder -->
- <fragmentsBuilder name="colored"
- class="solr.highlight.ScoreOrderFragmentsBuilder">
- <lst name="defaults">
- <str name="hl.tag.pre"><![CDATA[
- <b style="background:yellow">,<b style="background:lawgreen">,
- <b style="background:aquamarine">,<b style="background:magenta">,
- <b style="background:palegreen">,<b style="background:coral">,
- <b style="background:wheat">,<b style="background:khaki">,
- <b style="background:lime">,<b style="background:deepskyblue">]]></str>
- <str name="hl.tag.post"><![CDATA[</b>]]></str>
- </lst>
- </fragmentsBuilder>
-
- <boundaryScanner name="default"
- default="true"
- class="solr.highlight.SimpleBoundaryScanner">
- <lst name="defaults">
- <str name="hl.bs.maxScan">10</str>
- <str name="hl.bs.chars">.,!? 	 </str>
- </lst>
- </boundaryScanner>
-
- <boundaryScanner name="breakIterator"
- class="solr.highlight.BreakIteratorBoundaryScanner">
- <lst name="defaults">
- <!-- type should be one of CHARACTER, WORD(default), LINE and SENTENCE -->
- <str name="hl.bs.type">WORD</str>
- <!-- language and country are used when constructing Locale object. -->
- <!-- And the Locale object will be used when getting instance of BreakIterator -->
- <str name="hl.bs.language">en</str>
- <str name="hl.bs.country">US</str>
- </lst>
- </boundaryScanner>
- </highlighting>
- </searchComponent>
-
- <!-- Update Processors
-
- Chains of Update Processor Factories for dealing with Update
- Requests can be declared, and then used by name in Update
- Request Processors
-
- http://wiki.apache.org/solr/UpdateRequestProcessor
-
- -->
- <!-- Deduplication
-
- An example dedup update processor that creates the "id" field
- on the fly based on the hash code of some other fields. This
- example has overwriteDupes set to false since we are using the
- id field as the signatureField and Solr will maintain
- uniqueness based on that anyway.
-
- -->
- <!--
- <updateRequestProcessorChain name="dedupe">
- <processor class="solr.processor.SignatureUpdateProcessorFactory">
- <bool name="enabled">true</bool>
- <str name="signatureField">id</str>
- <bool name="overwriteDupes">false</bool>
- <str name="fields">name,features,cat</str>
- <str name="signatureClass">solr.processor.Lookup3Signature</str>
- </processor>
- <processor class="solr.LogUpdateProcessorFactory" />
- <processor class="solr.RunUpdateProcessorFactory" />
- </updateRequestProcessorChain>
- -->
-
- <!-- Language identification
-
- This example update chain identifies the language of the incoming
- documents using the langid contrib. The detected language is
- written to field language_s. No field name mapping is done.
- The fields used for detection are text, title, subject and description,
- making this example suitable for detecting languages form full-text
- rich documents injected via ExtractingRequestHandler.
- See more about langId at http://wiki.apache.org/solr/LanguageDetection
- -->
- <!--
- <updateRequestProcessorChain name="langid">
- <processor class="org.apache.solr.update.processor.TikaLanguageIdentifierUpdateProcessorFactory">
- <str name="langid.fl">text,title,subject,description</str>
- <str name="langid.langField">language_s</str>
- <str name="langid.fallback">en</str>
- </processor>
- <processor class="solr.LogUpdateProcessorFactory" />
- <processor class="solr.RunUpdateProcessorFactory" />
- </updateRequestProcessorChain>
- -->
-
- <!-- Script update processor
-
- This example hooks in an update processor implemented using JavaScript.
-
- See more about the script update processor at http://wiki.apache.org/solr/ScriptUpdateProcessor
- -->
- <!--
- <updateRequestProcessorChain name="script">
- <processor class="solr.StatelessScriptUpdateProcessorFactory">
- <str name="script">update-script.js</str>
- <lst name="params">
- <str name="config_param">example config parameter</str>
- </lst>
- </processor>
- <processor class="solr.RunUpdateProcessorFactory" />
- </updateRequestProcessorChain>
- -->
-
- <!-- Response Writers
-
- http://wiki.apache.org/solr/QueryResponseWriter
-
- Request responses will be written using the writer specified by
- the 'wt' request parameter matching the name of a registered
- writer.
-
- The "default" writer is the default and will be used if 'wt' is
- not specified in the request.
- -->
- <!-- The following response writers are implicitly configured unless
- overridden...
- -->
- <!--
- <queryResponseWriter name="xml"
- default="true"
- class="solr.XMLResponseWriter" />
- <queryResponseWriter name="json" class="solr.JSONResponseWriter"/>
- <queryResponseWriter name="python" class="solr.PythonResponseWriter"/>
- <queryResponseWriter name="ruby" class="solr.RubyResponseWriter"/>
- <queryResponseWriter name="php" class="solr.PHPResponseWriter"/>
- <queryResponseWriter name="phps" class="solr.PHPSerializedResponseWriter"/>
- <queryResponseWriter name="csv" class="solr.CSVResponseWriter"/>
- <queryResponseWriter name="schema.xml" class="solr.SchemaXmlResponseWriter"/>
- -->
-
- <queryResponseWriter name="json" class="solr.JSONResponseWriter">
- <!-- For the purposes of the tutorial, JSON responses are written as
- plain text so that they are easy to read in *any* browser.
- If you expect a MIME type of "application/json" just remove this override.
- -->
- <str name="content-type">text/plain; charset=UTF-8</str>
- </queryResponseWriter>
-
- <!--
- Custom response writers can be declared as needed...
- -->
- <queryResponseWriter name="velocity" class="solr.VelocityResponseWriter" startup="lazy"/>
-
-
- <!-- XSLT response writer transforms the XML output by any xslt file found
- in Solr's conf/xslt directory. Changes to xslt files are checked for
- every xsltCacheLifetimeSeconds.
- -->
- <queryResponseWriter name="xslt" class="solr.XSLTResponseWriter">
- <int name="xsltCacheLifetimeSeconds">5</int>
- </queryResponseWriter>
-
- <!-- Query Parsers
-
- http://wiki.apache.org/solr/SolrQuerySyntax
-
- Multiple QParserPlugins can be registered by name, and then
- used in either the "defType" param for the QueryComponent (used
- by SearchHandler) or in LocalParams
- -->
- <!-- example of registering a query parser -->
- <!--
- <queryParser name="myparser" class="com.mycompany.MyQParserPlugin"/>
- -->
-
- <!-- Function Parsers
-
- http://wiki.apache.org/solr/FunctionQuery
-
- Multiple ValueSourceParsers can be registered by name, and then
- used as function names when using the "func" QParser.
- -->
- <!-- example of registering a custom function parser -->
- <!--
- <valueSourceParser name="myfunc"
- class="com.mycompany.MyValueSourceParser" />
- -->
-
-
- <!-- Document Transformers
- http://wiki.apache.org/solr/DocTransformers
- -->
- <!--
- Could be something like:
- <transformer name="db" class="com.mycompany.LoadFromDatabaseTransformer" >
- <int name="connection">jdbc://....</int>
- </transformer>
-
- To add a constant value to all docs, use:
... 268 lines suppressed ...