paulcwarren / solr-embedded

An embedded Apache Solr instance and @EnableEmbeddedSolr Spring configuration annotation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

solr-embedded

An embedded Apache Solr instance for Spring Boot application.

Usage

Add the following Maven dependencies to your pom.xml:

<dependency>
  <groupId>com.github.paulcwarren</groupId>
  <artifactId>solr-embedded</artifactId>
  <version>0.0.1-SNAPSHOT</version>
</dependency>

Spring Boot (2.0.5.RELEASE) currently sets the version of solr dependencies to 6.6.5 so it is necessry to override those dependencies in your pom with the following dependency management section:

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.apache.solr</groupId>
      <artifactId>solr-core</artifactId>
      <version>7.2.1</version>
    </dependency>
    <dependency>
      <groupId>org.apache.solr</groupId>
      <artifactId>solr-cell</artifactId>
      <version>7.2.1</version>
    </dependency>
  </dependencies>
</dependencyManagement>

Add the following Java configuration to your application:

@Configuration
@EnableSolrEmbedded
public class SolrConfig {}	

This will start an embedded Apache Solr instance available at http://localhost:8080/solr/solr.

Published to maven central using:-

mvn clean deploy -Dgpg.passphrase=<passphrase>

About

An embedded Apache Solr instance and @EnableEmbeddedSolr Spring configuration annotation

License:Apache License 2.0


Languages

Language:Java 100.0%