Search Scroll API: Allow to provide the scroll id as the body of the scroll request, closes #545.

This commit is contained in:
kimchy 2010-11-29 13:59:30 +02:00
parent 103221e58a
commit c0945831e8
1 changed files with 5 additions and 1 deletions

View File

@ -52,7 +52,11 @@ public class RestSearchScrollAction extends BaseRestHandler {
}
@Override public void handleRequest(final RestRequest request, final RestChannel channel) {
SearchScrollRequest searchScrollRequest = new SearchScrollRequest(request.param("scroll_id"));
String scrollId = request.param("scroll_id");
if (scrollId == null && request.hasContent()) {
scrollId = request.contentAsString();
}
SearchScrollRequest searchScrollRequest = new SearchScrollRequest(scrollId);
try {
String scroll = request.param("scroll");
if (scroll != null) {