如何批量运行多个请求?
是否可以批量运行多个 solr 请求?我想一次运行多个查询并在一个请求中获取所有结果。
Is it possible to run multiple solr requests in a batch? I would like to run multiple queries at once and get all the results in one request.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
查询批处理是一个悬而未决的问题。您可以执行以下操作(按有用性降序排列):
Query batching is a pending issue. You can do the following (in descending order of usefulness):
我不确定您是否仍在寻找此功能。如果是的话,您可以查看我最近提交的补丁。
https://issues.apache.org/jira/browse/SOLR-1093
我们已经在生产服务器中使用它,并且已经运行良好一个多月了。
I am not sure if you are still looking for this feature. If you are, you could checkout the patch I submitted recently.
https://issues.apache.org/jira/browse/SOLR-1093
We have been using it in our production servers and it has been running fine for more than a month now.
不确定你能做到这一点。您一次只能运行一个查询。如果您想同时运行多个查询,您可以多线程查询
not sure you can do that. You can only run one query at a time. If you want to run many queries at the same time, you can multithread your queries
我对卡西克的解决方案进行了修复。
如果发送多个查询,则生成的 json 将无效,因为它有两个或多个“响应”键。
在此补丁中,每个响应都有一个标识符的相应查询。
例如。:
{ "1.response" : ..., "2.response" : ... }
注意:该补丁应使用
patch -p1
应用,并且是从 lucene 5.3I did a fix on Karthick's solution.
If multi queries were sent, the resulting json would be invalid, since it'd have two or more "response" keys.
In this patch, each response has an identifier of the corresponding query.
Eg.:
{ "1.response" : ..., "2.response" : ... }
Notice: The patch should be applied with
patch -p1
and it was done from lucene 5.3