Package org.elasticsearch.action.admin.indices.refresh

Examples of org.elasticsearch.action.admin.indices.refresh.RefreshRequest


     * @param indices The indices to refresh. Use <tt>null</tt> or <tt>_all</tt> to execute against all indices
     * @return The refresh request
     * @see org.elasticsearch.client.IndicesAdminClient#refresh(org.elasticsearch.action.admin.indices.refresh.RefreshRequest)
     */
    public static RefreshRequest refreshRequest(String... indices) {
        return new RefreshRequest(indices);
    }
View Full Code Here


* @author kimchy (shay.banon)
*/
public class RefreshRequestBuilder extends BaseIndicesRequestBuilder<RefreshRequest, RefreshResponse> {

    public RefreshRequestBuilder(IndicesAdminClient indicesClient) {
        super(indicesClient, new RefreshRequest());
    }
View Full Code Here

        controller.registerHandler(GET, "/_refresh", this);
        controller.registerHandler(GET, "/{index}/_refresh", this);
    }

    @Override public void handleRequest(final RestRequest request, final RestChannel channel) {
        RefreshRequest refreshRequest = new RefreshRequest(RestActions.splitIndices(request.param("index")));
        // we just send back a response, no need to fork a listener
        refreshRequest.listenerThreaded(false);
        BroadcastOperationThreading operationThreading = BroadcastOperationThreading.fromString(request.param("operation_threading"), BroadcastOperationThreading.SINGLE_THREAD);
        if (operationThreading == BroadcastOperationThreading.NO_THREADS) {
            // since we don't spawn, don't allow no_threads, but change it to a single thread
            operationThreading = BroadcastOperationThreading.THREAD_PER_SHARD;
        }
        refreshRequest.operationThreading(operationThreading);
        client.admin().indices().refresh(refreshRequest, new ActionListener<RefreshResponse>() {
            @Override public void onResponse(RefreshResponse response) {
                try {
                    XContentBuilder builder = RestXContentBuilder.restContentBuilder(request);
                    builder.startObject();
View Full Code Here

*/
@SuppressWarnings("unused")
public class RefreshRequestBuilder<JsonInput, JsonOutput> extends AbstractRequestBuilderJsonOutput<RefreshRequest, RefreshResponse, JsonInput, JsonOutput> {

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

        IndexResponse rsp = req.execute().actionGet();
        return rsp.getId();
    }

    private void refresh(String index) {
        client.admin().indices().refresh(new RefreshRequest(index)).actionGet();
    }
View Full Code Here

            if (delete) {
           
                // make sure to refresh the index here
                // (e.g. the index may be paused or refreshing with a very long interval):
                logger.info("refreshing " + searchIndexName);
                client.admin().indices().refresh(new RefreshRequest(newIndexName)).actionGet();
           
                long oldCount = client.count(new CountRequest(searchIndexName)).actionGet().getCount();
                long newCount = client.count(new CountRequest(newIndexName)).actionGet().getCount();
                if (oldCount == newCount) {
                    logger.info("deleting " + searchIndexName);
View Full Code Here

    public void refresh(Collection<String> indices) {
        refresh(Helper.toStringArray(indices));
    }

    public void refresh(String... indices) {
        RefreshResponse rsp = client.admin().indices().refresh(new RefreshRequest(indices)).actionGet();
        //assertEquals(1, rsp.getFailedShards());
    }
View Full Code Here

    public void refresh(Collection<String> indices) {
        refresh(Helper.toStringArray(indices));
    }

    public void refresh(String... indices) {
        RefreshResponse rsp = client.admin().indices().refresh(new RefreshRequest(indices)).actionGet();
        //assertEquals(1, rsp.getFailedShards());
    }
View Full Code Here

    /**
     * Refresh an index
     * @param indexName
     */
    private static void refresh(String indexName) {
        IndexClient.client.admin().indices().refresh(new RefreshRequest(indexName)).actionGet();
    }
View Full Code Here

    }
   
    private final String indexName = "photon";

    protected void refresh() {
        getClient().admin().indices().refresh(new RefreshRequest(indexName)).actionGet();
    }
View Full Code Here

TOP

Related Classes of org.elasticsearch.action.admin.indices.refresh.RefreshRequest

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.