Package org.elasticsearch.action.search

Examples of org.elasticsearch.action.search.SearchScrollRequest


     * @param scrollId The scroll id representing the scrollable search
     * @return The search scroll request
     * @see org.elasticsearch.client.Client#searchScroll(org.elasticsearch.action.search.SearchScrollRequest)
     */
    public static SearchScrollRequest searchScrollRequest(String scrollId) {
        return new SearchScrollRequest(scrollId);
    }
View Full Code Here


* @author kimchy (shay.banon)
*/
public class SearchScrollRequestBuilder extends BaseRequestBuilder<SearchScrollRequest, SearchResponse> {

    public SearchScrollRequestBuilder(Client client, String scrollId) {
        super(client, new SearchScrollRequest(scrollId));
    }
View Full Code Here

    @Override public void handleRequest(final RestRequest request, final RestChannel channel) {
        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) {
                searchScrollRequest.scroll(new Scroll(parseTimeValue(scroll, null)));
            }
            searchScrollRequest.listenerThreaded(false);
            SearchOperationThreading operationThreading = SearchOperationThreading.fromString(request.param("operation_threading"), null);
            if (operationThreading != null) {
                if (operationThreading == SearchOperationThreading.NO_THREADS) {
                    // since we don't spawn, don't allow no_threads, but change it to a single thread
                    operationThreading = SearchOperationThreading.SINGLE_THREAD;
                }
                searchScrollRequest.operationThreading(operationThreading);
            }
        } catch (Exception e) {
            try {
                XContentBuilder builder = restContentBuilder(request);
                channel.sendResponse(new XContentRestResponse(request, BAD_REQUEST, builder.startObject().field("error", e.getMessage()).endObject()));
View Full Code Here

* Request builder for scroll API
*/
public class SearchScrollRequestBuilder<JsonInput, JsonOutput> extends AbstractRequestBuilderToXContent<SearchScrollRequest, SearchResponse, JsonInput, JsonOutput> {

    public SearchScrollRequestBuilder(Client client, JsonToString<JsonInput> jsonToString, StringToJson<JsonOutput> stringToJson) {
        super(client, new SearchScrollRequest(), jsonToString, stringToJson);
    }
View Full Code Here

     * @param scrollId The scroll id representing the scrollable search
     * @return The search scroll request
     * @see org.elasticsearch.client.Client#searchScroll(org.elasticsearch.action.search.SearchScrollRequest)
     */
    public static SearchScrollRequest searchScrollRequest(String scrollId) {
        return new SearchScrollRequest(scrollId);
    }
View Full Code Here

    public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) {
        String scrollId = request.param("scroll_id");
        if (scrollId == null) {
            scrollId = RestActions.getRestContent(request).toUtf8();
        }
        SearchScrollRequest searchScrollRequest = new SearchScrollRequest(scrollId);
        searchScrollRequest.listenerThreaded(false);
        String scroll = request.param("scroll");
        if (scroll != null) {
            searchScrollRequest.scroll(new Scroll(parseTimeValue(scroll, null)));
        }

        client.searchScroll(searchScrollRequest, new RestStatusToXContentListener<SearchResponse>(channel));
    }
View Full Code Here

TOP

Related Classes of org.elasticsearch.action.search.SearchScrollRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.