如何批量运行多个请求?

发布于 2024-11-10 02:40:31 字数 50 浏览 4 评论 0原文

是否可以批量运行多个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

抠脚大汉 2024-11-17 02:40:31

查询批处理是一个悬而未决的问题。您可以执行以下操作(按有用性降序排列):

  • 实现该功能并将其作为上述 JIRA 问题的补丁提交。
  • 通过向上述 JIRA 问题发布建议,与对此功能感兴趣的其他人进行协作。
  • 实现并发查询客户端(即没有 Solr 的任何类型的支持)。
  • 投票/观看上述 JIRA 问题。

Query batching is a pending issue. You can do the following (in descending order of usefulness):

  • Implement the feature and submit it as a patch to the aforementioned JIRA issue.
  • Collaborate with other people interested in this feature, by posting a suggestion to the aforementioned JIRA issue.
  • Implement concurrent querying client-side (i.e. without any kind of support from Solr).
  • Vote/watch the aforementioned JIRA issue.
流年里的时光 2024-11-17 02:40:31

我不确定您是否仍在寻找此功能。如果是的话,您可以查看我最近提交的补丁。

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.

与他有关 2024-11-17 02:40:31

不确定你能做到这一点。您一次只能运行一个查询。如果您想同时运行多个查询,您可以多线程查询

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

尸血腥色 2024-11-17 02:40:31

我对卡西克的解决方案进行了修复。
如果发送多个查询,则生成的 json 将无效,因为它有两个或多个“响应”键。
在此补丁中,每个响应都有一个标识符的相应查询。
例如。:
{ "1.response" : ..., "2.response" : ... }

注意:该补丁应使用 patch -p1 应用,并且是从 lucene 5.3

I 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文