Solr6.6.2之整合SolrJ和Spring

在maven项目里引入以下依赖

<dependency>
    <groupId>org.apache.solrgroupId>
    <artifactId>solr-solrjartifactId>
    <version>6.6.2version>
dependency>

spring配置文件

<bean id="httpSolrClient" class="org.apache.solr.client.solrj.impl.HttpSolrClient">
    <constructor-arg name="baseURL" value="http://192.168.41.132:18080/solr6/taotao_item" />
bean>

Service层

@Resource
private HttpSolrClient solrClient;

你可能感兴趣的:(【中间件】Solr)