org.elasticsearch.action.admin.indices.optimize
Class OptimizeRequestBuilder

java.lang.Object
  extended by org.elasticsearch.action.admin.indices.support.BaseIndicesRequestBuilder<OptimizeRequest,OptimizeResponse>
      extended by org.elasticsearch.action.admin.indices.optimize.OptimizeRequestBuilder
All Implemented Interfaces:
ActionRequestBuilder<OptimizeRequest,OptimizeResponse>

public class OptimizeRequestBuilder
extends BaseIndicesRequestBuilder<OptimizeRequest,OptimizeResponse>

A request to optimize one or more indices. In order to optimize on all the indices, pass an empty array or null for the indices.

setWaitForMerge(boolean) allows to control if the call will block until the optimize completes and defaults to true.

setMaxNumSegments(int) allows to control the number of segments to optimize down to. By default, will cause the optimize process to optimize down to half the configured number of segments.


Field Summary
 
Fields inherited from class org.elasticsearch.action.admin.indices.support.BaseIndicesRequestBuilder
client, request
 
Constructor Summary
OptimizeRequestBuilder(IndicesAdminClient indicesClient)
           
 
Method Summary
protected  void doExecute(ActionListener<OptimizeResponse> listener)
           
 OptimizeRequestBuilder setFlush(boolean flush)
          Should flush be performed after the optimization.
 OptimizeRequestBuilder setIgnoreIndices(IgnoreIndices ignoreIndices)
          Specifies what type of requested indices to ignore.
 OptimizeRequestBuilder setIndices(String... indices)
           
 OptimizeRequestBuilder setListenerThreaded(boolean threadedListener)
          Should the listener be called on a separate thread if needed.
 OptimizeRequestBuilder setMaxNumSegments(int maxNumSegments)
          Will optimize the index down to <= maxNumSegments.
 OptimizeRequestBuilder setOnlyExpungeDeletes(boolean onlyExpungeDeletes)
          Should the optimization only expunge deletes from the index, without full optimization.
 OptimizeRequestBuilder setOperationThreading(BroadcastOperationThreading operationThreading)
          Controls the operation threading model.
 OptimizeRequestBuilder setRefresh(boolean refresh)
          Should refresh be performed after the optimization.
 OptimizeRequestBuilder setWaitForMerge(boolean waitForMerge)
          Should the call block until the optimize completes.
 
Methods inherited from class org.elasticsearch.action.admin.indices.support.BaseIndicesRequestBuilder
execute, execute, request
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OptimizeRequestBuilder

public OptimizeRequestBuilder(IndicesAdminClient indicesClient)
Method Detail

setIndices

public OptimizeRequestBuilder setIndices(String... indices)

setWaitForMerge

public OptimizeRequestBuilder setWaitForMerge(boolean waitForMerge)
Should the call block until the optimize completes. Defaults to true.


setMaxNumSegments

public OptimizeRequestBuilder setMaxNumSegments(int maxNumSegments)
Will optimize the index down to <= maxNumSegments. By default, will cause the optimize process to optimize down to half the configured number of segments.


setOnlyExpungeDeletes

public OptimizeRequestBuilder setOnlyExpungeDeletes(boolean onlyExpungeDeletes)
Should the optimization only expunge deletes from the index, without full optimization. Defaults to full optimization (false).


setFlush

public OptimizeRequestBuilder setFlush(boolean flush)
Should flush be performed after the optimization. Defaults to true.


setRefresh

public OptimizeRequestBuilder setRefresh(boolean refresh)
Should refresh be performed after the optimization. Defaults to true.


setListenerThreaded

public OptimizeRequestBuilder setListenerThreaded(boolean threadedListener)
Should the listener be called on a separate thread if needed.


setOperationThreading

public OptimizeRequestBuilder setOperationThreading(BroadcastOperationThreading operationThreading)
Controls the operation threading model.


setIgnoreIndices

public OptimizeRequestBuilder setIgnoreIndices(IgnoreIndices ignoreIndices)
Specifies what type of requested indices to ignore. For example indices that don't exist.


doExecute

protected void doExecute(ActionListener<OptimizeResponse> listener)
Specified by:
doExecute in class BaseIndicesRequestBuilder<OptimizeRequest,OptimizeResponse>


Copyright © 2009-2012. All Rights Reserved.