Solr - 在数据导入中为获取查询传递自定义参数

时间:2014-05-02 10:22:51

标签: php search solr full-text-search solr4

我已将Solr配置为从MySql数据库导入数据。我需要传递一个参数(比如user_id),我需要从中获取的只是导入与传递的用户ID匹配的记录。

http://googlieye:8983/solr/db/dataimport?command=full-import& entity=user_data_import&user_id=431269

有可能完成这项工作吗?我还在努力解决这个问题。任何建议或想法都会有所帮助。

1 个答案:

答案 0 :(得分:0)

您可以传递查询参数,然后在data-config.xml中读取它们,如下所示:

select * from users where user_id=${dataimporter.request.entity}