开发者

How do I run multiple requests in a batch?

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.


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.


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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜