春季启动中的Apache Solr分布式搜索

时间:2020-05-14 23:19:40

标签: spring spring-data-solr

我们有一个基于Java的应用程序,使用Apache Solr APIS通过分布式搜索https://lucene.apache.org/solr/guide/6_6/distributed-search-with-index-sharding.html跨多个Core(集合)读取数据

http://localhost:8983/solr/core1/select?shards=solr1:8983/solr/core1,solr2:8983/solr/core1&indent=true&q=ipod+solr

可以使用以下Java来完成

SolrQuery query = new SolrQuery();
query.set("q", "http://localhost:8983/solr/core1/select?shards=solr1:8983/solr/engineers,solr1:8983/solr/designers&indent=true&q=(name:User_Name)");
QueryResponse response = solr.query(query);

SolrDocumentList docList = response.getResults();

上面的查询将在两个核心工程师和设计人员中搜索名称。

在Spring Boot中可以做同样的事情吗? https://spring.io/projects/spring-data-solr

0 个答案:

没有答案
相关问题