Package org.elasticsearch.action.admin.indices.optimize

Examples of org.elasticsearch.action.admin.indices.optimize.OptimizeRequest.upgrade()


   
    void handlePost(RestRequest request, RestChannel channel, Client client) {
        OptimizeRequest optimizeReq = new OptimizeRequest(Strings.splitStringByCommaToArray(request.param("index")));
        optimizeReq.waitForMerge(request.paramAsBoolean("wait_for_completion", false));
        optimizeReq.flush(true);
        optimizeReq.upgrade(true);
        optimizeReq.maxNumSegments(Integer.MAX_VALUE); // we just want to upgrade the segments, not actually optimize to a single segment
        client.admin().indices().optimize(optimizeReq, new RestBuilderListener<OptimizeResponse>(channel) {
            @Override
            public RestResponse buildResponse(OptimizeResponse response, XContentBuilder builder) throws Exception {
                builder.startObject();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.