繁体   English   中英

Solr搜索多个集合

[英]Solr search in multiple collections

Iam与Solr合作。 我的solr.xml文件看起来像这样。

<?xml version="1.0" encoding="UTF-8" ?>
<solr persistent="true">
  <cores defaultCoreName="test1" host="${host:}" adminPath="/admin/cores" zkClientTimeout="${zkClientTimeout:15000}" hostPort="${jetty.port:8983}" hostContext="${hostContext:solr}">
    <core loadOnStartup="true" instanceDir="test1/" transient="false" name="test1" collection="test1"/>
    <core loadOnStartup="true" instanceDir="test2/" transient="false" name="test2" collection="test2"/>
  </cores>
</solr>

现在,我想在两个集合中进行搜索。 所以我想要在collection1或collection2中命中的结果。

我必须发送两个请求,还是能够针对2个(或更多)集合处理一个请求。

我可以做这样的事情:

http://***.***.***.***:8080/solr/test1/select?q=field%3Dtest&wt=xml&indent=true
http://***.***.***.***:8080/solr/test2/select?q=field%3Dtest&wt=xml&indent=true

您可以检查Solr 分布式搜索 ,这将使您可以跨集合进行搜索。

但是,请确保在两个内核中都维护公用字段,以便查询找到它们并返回它们。
同样,分布式搜索也有一些局限性

否则,您需要进行不同的查询并合并结果。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM