问题
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>
回答1:
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.
来源:https://stackoverflow.com/questions/15734308/solrentityprocessor-is-called-only-once-for-sub-entities