如何连接两个solr索引并从两者获得结果?

时间:2015-10-08 10:57:11

标签: search solr lucene

我在两个不同的核心上有两个索引:

firstCore {id, fid, resid, status}
secondCore {id, resid, title, name, cat, role, exp}

我想执行一个连接查询,该连接查询将给出两个索引的结果,并且具有匹配条件,我的意思是显示id, fid, resid, status, title, name, cat, role, exp。如果需要,我们可以省略idid secondCore。{
我尝试了什么:
1.返回以下查询:id, fid, resid, status,即firstCore

 http://localhost:8888/solr/firstCore/select?q=*:*&fq={!join from=resid to=resid fromIndex=secondCore}resid:546384
  1. 以下查询返回:id, resid, title, name, cat, role, exp,即secondCore

    http://localhost:8888/solr/secondCore/select?q=*:*&fq={!join%20from=resid%20to=resid%20fromIndex=firstCore}resid:546384

  2. 我怎样才能获得id, fid, resid, status, title, name, cat, role, exp

1 个答案:

答案 0 :(得分:1)

这可以通过分片来实现,但截至目前还没有解决方法。

这可能有所帮助,请查看http://mail-archives.apache.org/mod_mbox/lucene-solr-user/201510.mbox/%3CCAEYSxhVie4oei+7sMFuAEZgOUxbJ-YM_hzHh54kgWiPqJuoFhQ@mail.gmail.com%3E