Package org.elasticsearch.action.admin.indices.warmer.put

Examples of org.elasticsearch.action.admin.indices.warmer.put.PutWarmerRequest


*/
@SuppressWarnings("unused")
public class PutWarmerRequestBuilder<JsonInput, JsonOutput> extends AbstractRequestBuilderJsonOutput<PutWarmerRequest, PutWarmerResponse, JsonInput, JsonOutput> {

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


        controller.registerHandler(POST, "/{index}/{type}/_warmers/{name}", this);
    }

    @Override
    public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) {
        PutWarmerRequest putWarmerRequest = new PutWarmerRequest(request.param("name"));
        putWarmerRequest.listenerThreaded(false);
        SearchRequest searchRequest = new SearchRequest(Strings.splitStringByCommaToArray(request.param("index")))
                .types(Strings.splitStringByCommaToArray(request.param("type")))
                .queryCache(request.paramAsBoolean("query_cache", null))
                .source(request.content(), request.contentUnsafe());
        searchRequest.indicesOptions(IndicesOptions.fromRequest(request, searchRequest.indicesOptions()));
        putWarmerRequest.searchRequest(searchRequest);
        putWarmerRequest.timeout(request.paramAsTime("timeout", putWarmerRequest.timeout()));
        putWarmerRequest.masterNodeTimeout(request.paramAsTime("master_timeout", putWarmerRequest.masterNodeTimeout()));
        client.admin().indices().putWarmer(putWarmerRequest, new AcknowledgedRestListener<PutWarmerResponse>(channel));
    }
View Full Code Here

TOP

Related Classes of org.elasticsearch.action.admin.indices.warmer.put.PutWarmerRequest

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.