SolrEntityProcessor 只为子实体调用一次 [英] SolrEntityProcessor is called only once for sub-entities

查看:15
本文介绍了SolrEntityProcessor 只为子实体调用一次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 Solr 4.2,我试图将 SolrEntityProcessor 称为子实体.到目前为止,只对 Solr 进行了一次调用,并且对单个文档进行了索引,而忽略了所有其他文档.这应该是可能的,但它似乎不起作用......有什么想法吗?

I'm using Solr 4.2, and I am trying to call SolrEntityProcessor as a sub-entity. So far, only one call is made to Solr and a single document is indexed while all others are ignored. This should be possible, but it doesn't seem to work... Any ideas?

代码截图:

<document>
  <entity dataSource="psql" name="user" query="SELECT * FROM users";>
    <field column="id" name="user_id" />

    <entity name="liked_items" processor="SolrEntityProcessor" url="http://localhost:8983/solr/items" query="user_liking_this:${user.id}" rows="1000" fl="item_id" >
      <field column="item_id" name="item_id" />
    </entity>

  </entity>
</document>

推荐答案

我刚刚在 这个 Solr JIRA 问题.经测试并按预期工作!

I've just found my answer in this Solr JIRA issue. Tested and working as expected!

解决方案是使用打过补丁的 SolrEntityProcessor 附加到问题,而不是包含在 DataImportHandler JAR 中的那个.

The solution is to use the patched SolrEntityProcessor attached to the issue instead of the one included in the DataImportHandler JAR.

请注意,对于 4.3.0 及更高版本(可能更高)的任何 Solr 版本,您都需要它 - 尽管问题状态和评论是这样说的,但似乎并未包含该补丁在任何现有版本中.

Note that you will need it for any Solr version up to and including 4.3.0 (and possibly higher) - despite what the issue status and comments say, the patch does not appear to be included in any existing version.

这篇关于SolrEntityProcessor 只为子实体调用一次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆