https://grokonez.com/spring-framework/spring-data/solr-start-spring-data-solr-springboot
Apache Solr – How to start Spring Data Solr with SpringBoot
Solr powers the search with highly reliable, centralized configuration, scalablility and more for heavily-trafficked websites and applications. So in the tutorial, JavaSampleApproach will show how to create a Spring Data Solr application with SpringBoot.
Related posts:
I. Technology
– Java 1.8
– Maven 3.3.9
– Spring Tool Suite – Version 3.8.1.RELEASE
– Spring Boot: 1.5.6RELEASE
- Solr 6.6.0
II. SpringBoot & Solr
SpringBoot provides spring-boot-starter-data-solr
Starter to support connecting and abstractions on top of Spring Data Solr.
1. Solr connection
In application.properties file, We use spring.data.solr.*
to configure Solr connection.
Here is the details of sourcecode - SolrProperties:
@ConfigurationProperties(prefix = "spring.data.solr")
public class SolrProperties {
/**
* Solr host. Ignored if "zk-host" is set.
*/
private String host = "http://127.0.0.1:8983/solr";
/**
* ZooKeeper host address in the form HOST:PORT.
*/
private String zkHost;
...
}
By default the instance will attempt to connect to a server using http://localhost:8983/solr
. And we can add @Bean
with SolrClient type to override it.
2. Spring Data Solr repositories
We use @SolrDocument
to create Solr document:
More at:
https://grokonez.com/spring-framework/spring-data/solr-start-spring-data-solr-springboot
Apache Solr – How to start Spring Data Solr with SpringBoot
Top comments (0)