private SearchRequest parseSearchRequest(RestRequest request) {
		String[] indices = RestActions.splitIndices(request.param("index"));
		SearchRequest searchRequest = new SearchRequest(indices);
		// get the content, and put it in the body
		if (request.hasContent()) {
			searchRequest.source(request.content(), request.contentUnsafe());
		} else {
			String source = request.param("source");
			if (source != null) {
				searchRequest.source(source);
			}
		}
		// add extra source based on the request parameters
		searchRequest.extraSource(parseSearchSource(request));

		searchRequest.searchType(request.param("search_type"));

		String scroll = request.param("scroll");
		if (scroll != null) {
			searchRequest.scroll(new Scroll(parseTimeValue(scroll, null)));
		}

		searchRequest.types(RestActions.splitTypes(request.param("type")));
		searchRequest.routing(request.param("routing"));
		searchRequest.preference(request.param("preference"));
		if (request.hasParam("ignore_indices")) {
			searchRequest.ignoreIndices(IgnoreIndices.fromString(request.param("ignore_indices")));
		}

		return searchRequest;
	}