Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
641 views
in Technique[技术] by (71.8m points)

solr - SolrEntityProcessor is called only once for sub-entities

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?

Code snippist:

<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>
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

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

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...