Solr Spring Client

A Solr Client Factory for Spring

Лицензия

Лицензия

Категории

Категории

CLI Взаимодействие с пользователем
Группа

Группа

com.indoqa.solr
Идентификатор

Идентификатор

solr-spring-client
Последняя версия

Последняя версия

8.2.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

Solr Spring Client
A Solr Client Factory for Spring
Ссылка на сайт

Ссылка на сайт

https://github.com/indoqa/solr-spring-client/
Организация-разработчик

Организация-разработчик

Indoqa Software Design und Beratung GmbH
Система контроля версий

Система контроля версий

https://github.com/Indoqa/solr-spring-client

Скачать solr-spring-client

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.indoqa.solr/solr-spring-client/ -->
<dependency>
    <groupId>com.indoqa.solr</groupId>
    <artifactId>solr-spring-client</artifactId>
    <version>8.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.indoqa.solr/solr-spring-client/
implementation 'com.indoqa.solr:solr-spring-client:8.2.0'
// https://jarcasting.com/artifacts/com.indoqa.solr/solr-spring-client/
implementation ("com.indoqa.solr:solr-spring-client:8.2.0")
'com.indoqa.solr:solr-spring-client:jar:8.2.0'
<dependency org="com.indoqa.solr" name="solr-spring-client" rev="8.2.0">
  <artifact name="solr-spring-client" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.indoqa.solr', module='solr-spring-client', version='8.2.0')
)
libraryDependencies += "com.indoqa.solr" % "solr-spring-client" % "8.2.0"
[com.indoqa.solr/solr-spring-client "8.2.0"]

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
org.apache.solr : solr-solrj jar 8.2.0
org.apache.solr : solr-core Необязательный jar 8.2.0
org.springframework : spring-beans jar 4.1.7.RELEASE

provided (3)

Идентификатор библиотеки Тип Версия
org.slf4j : slf4j-api jar 1.7.7
org.slf4j : jcl-over-slf4j Необязательный jar 1.7.7
org.slf4j : jul-to-slf4j Необязательный jar 1.7.7

test (1)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.10

Модули Проекта

Данный проект не имеет модулей.

Indoqa Solr Spring Client

This project offers a Spring based implementation of a FactoryBean for communicating with Apache Solr servers.

The SolrClientFactory allows to communicate with Solr either embedded, via http or Apache ZooKeeper for SolrCloud installations.

The desired behavior is configured with the supplied url:

  • file:// - uses the EmbeddedSolrClient
  • http:// - uses the HttpSolrClient
  • cloud:// - uses the CloudSolrClient

Installation

Requirements

  • Apache Solr 8.0+
  • Spring Beans 4.1+
  • Java 8+

Build

  • Download the latest release via maven
    <dependency>
      <groupId>com.indoqa.solr</groupId>
      <artifactId>solr-spring-client</artifactId>
    </dependency>
    
  • Download source
  • run "maven clean install"

Configuration

Initialize the SolrClientFactory for tests with this snippet

    SolrClientFactory solrClientFactory = new SolrClientFactory();
    solrClientFactory.setUrl("file:///tmp/solr-spring-server/embedded-test-core");
    solrClientFactory.setEmbeddedSolrConfigurationDir("./src/test/resources/solr/test-core");
    solrClientFactory.initialize();

    SolrServer solrServer = solrClientFactory.getObject();

    QueryResponse response = solrServer.query(new SolrQuery("*:*"));

    ...

    solrServer.shutdown();
    solrClientFactory.destroy();

The url can either be a relative or absolute directory, the embeddedSolrConfigurationDir must include the usual Solr configuration files:

  • schema.xml
  • solrconfig.xml

To communicate with a single Solr server use this snippet

    SolrClientFactory solrClientFactory = new SolrClientFactory();
    solrClientFactory.setUrl("http://localhost:8983/test-core");
    solrClientFactory.initialize();

To communicate with a SolrCloud cluster use this snippet

   SolrClientFactory solrClientFactory = new SolrClientFactory();
   solrClientFactory.setUrl("cloud://zkHost1:2181,zkHost2:2182?collection=test-collection");
   solrClientFactory.initialize();

The syntax uses zkHost1:2181,zkHost2:2182 for the ZooKeeper instances in your ZooKeeper ensemble, followed by the collection to be used. This ensures that the communication for update requests will be established against the leader of the collection to minimize communication overhead.

Solr Spring server integration based on xml configuration

   <bean name="solrClientFactory" class="com.indoqa.solr.server.factory.SolrClientFactory">
     <property name="url" value="file://./target/solr/embedded-test-core" />
     <property name="embeddedSolrConfigurationDir" value="./src/test/resources/solr/test-core" />
   </bean>
com.indoqa.solr

Indoqa

Версии библиотеки

Версия
8.2.0
7.7.2
7.2.1
7.2.0
6.6.2
6.1.0
5.1.1
5.1.0