简体   繁体   English

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

[英]Solr - Passing custom parameter for fetch query in Data Import

I have configured Solr to import data from MySql database. 我已配置Solr从MySql数据库导入数据。 I need to pass a parameter ( say user_id ) and what I need to gain out of this is to import only the record that matches the passed user id. 我需要传递一个参数(例如user_id),我需要从中获取的是仅导入与传递的用户ID匹配的记录。

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

Is it possible to get this done? 有可能做到这一点吗? I'm still trying to work this out. 我仍在努力解决。 Any kind of suggestion or idea would be helpful. 任何类型的建议或想法都会有所帮助。

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM