Permalink
Browse files

Fixed no valid missing index type error.

  • Loading branch information...
1 parent 24ce2ef commit 33e7d769cad8720c8c5d69a07c20a27baa4bab0b @martijnvg martijnvg committed Sep 5, 2012
@@ -59,7 +59,9 @@ public RestClearIndicesCacheAction(Settings settings, Client client, RestControl
public void handleRequest(final RestRequest request, final RestChannel channel) {
ClearIndicesCacheRequest clearIndicesCacheRequest = new ClearIndicesCacheRequest(RestActions.splitIndices(request.param("index")));
clearIndicesCacheRequest.listenerThreaded(false);
- clearIndicesCacheRequest.ignoreIndices(IgnoreIndices.fromString(request.param("ignore_indices")));
+ if (request.hasParam("ignore_indices")) {
+ clearIndicesCacheRequest.ignoreIndices(IgnoreIndices.fromString(request.param("ignore_indices")));
+ }
try {
clearIndicesCacheRequest.filterCache(request.paramAsBoolean("filter", clearIndicesCacheRequest.filterCache()));
clearIndicesCacheRequest.fieldDataCache(request.paramAsBoolean("field_data", clearIndicesCacheRequest.fieldDataCache()));
@@ -58,7 +58,9 @@ public RestFlushAction(Settings settings, Client client, RestController controll
public void handleRequest(final RestRequest request, final RestChannel channel) {
FlushRequest flushRequest = new FlushRequest(RestActions.splitIndices(request.param("index")));
flushRequest.listenerThreaded(false);
- flushRequest.ignoreIndices(IgnoreIndices.fromString(request.param("ignore_indices")));
+ if (request.hasParam("ignore_indices")) {
+ flushRequest.ignoreIndices(IgnoreIndices.fromString(request.param("ignore_indices")));
+ }
BroadcastOperationThreading operationThreading = BroadcastOperationThreading.fromString(request.param("operationThreading"), 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
@@ -53,7 +53,9 @@ public RestGatewaySnapshotAction(Settings settings, Client client, RestControlle
public void handleRequest(final RestRequest request, final RestChannel channel) {
GatewaySnapshotRequest gatewaySnapshotRequest = new GatewaySnapshotRequest(RestActions.splitIndices(request.param("index")));
gatewaySnapshotRequest.listenerThreaded(false);
- gatewaySnapshotRequest.ignoreIndices(IgnoreIndices.fromString(request.param("ignore_indices")));
+ if (request.hasParam("ignore_indices")) {
+ gatewaySnapshotRequest.ignoreIndices(IgnoreIndices.fromString(request.param("ignore_indices")));
+ }
client.admin().indices().gatewaySnapshot(gatewaySnapshotRequest, new ActionListener<GatewaySnapshotResponse>() {
@Override
public void onResponse(GatewaySnapshotResponse response) {
@@ -59,7 +59,9 @@ public RestOptimizeAction(Settings settings, Client client, RestController contr
public void handleRequest(final RestRequest request, final RestChannel channel) {
OptimizeRequest optimizeRequest = new OptimizeRequest(RestActions.splitIndices(request.param("index")));
optimizeRequest.listenerThreaded(false);
- optimizeRequest.ignoreIndices(IgnoreIndices.fromString(request.param("ignore_indices")));
+ if (request.hasParam("ignore_indices")) {
+ optimizeRequest.ignoreIndices(IgnoreIndices.fromString(request.param("ignore_indices")));
+ }
try {
optimizeRequest.waitForMerge(request.paramAsBoolean("wait_for_merge", optimizeRequest.waitForMerge()));
optimizeRequest.maxNumSegments(request.paramAsInt("max_num_segments", optimizeRequest.maxNumSegments()));
@@ -58,7 +58,9 @@ public RestRefreshAction(Settings settings, Client client, RestController contro
public void handleRequest(final RestRequest request, final RestChannel channel) {
RefreshRequest refreshRequest = new RefreshRequest(RestActions.splitIndices(request.param("index")));
refreshRequest.listenerThreaded(false);
- refreshRequest.ignoreIndices(IgnoreIndices.fromString(request.param("ignore_indices")));
+ if (request.hasParam("ignore_indices")) {
+ refreshRequest.ignoreIndices(IgnoreIndices.fromString(request.param("ignore_indices")));
+ }
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
@@ -53,7 +53,9 @@ public RestIndicesSegmentsAction(Settings settings, Client client, RestControlle
public void handleRequest(final RestRequest request, final RestChannel channel) {
IndicesSegmentsRequest indicesSegmentsRequest = new IndicesSegmentsRequest(splitIndices(request.param("index")));
indicesSegmentsRequest.listenerThreaded(false);
- indicesSegmentsRequest.ignoreIndices(IgnoreIndices.fromString(request.param("ignore_indices")));
+ if (request.hasParam("ignore_indices")) {
+ indicesSegmentsRequest.ignoreIndices(IgnoreIndices.fromString(request.param("ignore_indices")));
+ }
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
@@ -83,7 +83,9 @@ public RestIndicesStatsAction(Settings settings, Client client, RestController c
public void handleRequest(final RestRequest request, final RestChannel channel) {
IndicesStatsRequest indicesStatsRequest = new IndicesStatsRequest();
indicesStatsRequest.listenerThreaded(false);
- indicesStatsRequest.ignoreIndices(IgnoreIndices.fromString(request.param("ignore_indices")));
+ if (request.hasParam("ignore_indices")) {
+ indicesStatsRequest.ignoreIndices(IgnoreIndices.fromString(request.param("ignore_indices")));
+ }
boolean clear = request.paramAsBoolean("clear", false);
if (clear) {
indicesStatsRequest.clear();
@@ -60,7 +60,9 @@ public RestIndicesStatusAction(Settings settings, Client client, RestController
public void handleRequest(final RestRequest request, final RestChannel channel) {
IndicesStatusRequest indicesStatusRequest = new IndicesStatusRequest(splitIndices(request.param("index")));
indicesStatusRequest.listenerThreaded(false);
- indicesStatusRequest.ignoreIndices(IgnoreIndices.fromString(request.param("ignore_indices")));
+ if (request.hasParam("ignore_indices")) {
+ indicesStatusRequest.ignoreIndices(IgnoreIndices.fromString(request.param("ignore_indices")));
+ }
indicesStatusRequest.recovery(request.paramAsBoolean("recovery", indicesStatusRequest.recovery()));
indicesStatusRequest.snapshot(request.paramAsBoolean("snapshot", indicesStatusRequest.snapshot()));
BroadcastOperationThreading operationThreading = BroadcastOperationThreading.fromString(request.param("operation_threading"), BroadcastOperationThreading.SINGLE_THREAD);
@@ -63,7 +63,9 @@ public RestValidateQueryAction(Settings settings, Client client, RestController
public void handleRequest(final RestRequest request, final RestChannel channel) {
ValidateQueryRequest validateQueryRequest = new ValidateQueryRequest(RestActions.splitIndices(request.param("index")));
validateQueryRequest.listenerThreaded(false);
- validateQueryRequest.ignoreIndices(IgnoreIndices.fromString(request.param("ignore_indices")));
+ if (request.hasParam("ignore_indices")) {
+ validateQueryRequest.ignoreIndices(IgnoreIndices.fromString(request.param("ignore_indices")));
+ }
try {
BroadcastOperationThreading operationThreading = BroadcastOperationThreading.fromString(request.param("operation_threading"), BroadcastOperationThreading.SINGLE_THREAD);
if (operationThreading == BroadcastOperationThreading.NO_THREADS) {
@@ -62,7 +62,9 @@ public RestCountAction(Settings settings, Client client, RestController controll
@Override
public void handleRequest(final RestRequest request, final RestChannel channel) {
CountRequest countRequest = new CountRequest(RestActions.splitIndices(request.param("index")));
- countRequest.ignoreIndices(IgnoreIndices.fromString(request.param("ignore_indices")));
+ if (request.hasParam("ignore_indices")) {
+ countRequest.ignoreIndices(IgnoreIndices.fromString(request.param("ignore_indices")));
+ }
countRequest.listenerThreaded(false);
try {
BroadcastOperationThreading operationThreading = BroadcastOperationThreading.fromString(request.param("operation_threading"), BroadcastOperationThreading.SINGLE_THREAD);
@@ -61,7 +61,10 @@ public void handleRequest(final RestRequest request, final RestChannel channel)
String[] indices = RestActions.splitIndices(request.param("index"));
String[] types = RestActions.splitTypes(request.param("type"));
- IgnoreIndices ignoreIndices = IgnoreIndices.fromString(request.param("ignore_indices"));
+ IgnoreIndices ignoreIndices = null;
+ if (request.hasParam("ignore_indices")) {
+ IgnoreIndices.fromString(request.param("ignore_indices"));
+ }
try {
multiSearchRequest.add(request.content(), request.contentUnsafe(), indices, types, request.param("search_type"), ignoreIndices);
@@ -142,7 +142,9 @@ private SearchRequest parseSearchRequest(RestRequest request) {
searchRequest.queryHint(request.param("query_hint"));
searchRequest.routing(request.param("routing"));
searchRequest.preference(request.param("preference"));
- searchRequest.ignoreIndices(IgnoreIndices.fromString(request.param("ignore_indices")));
+ if (request.hasParam("ignore_indices")) {
+ searchRequest.ignoreIndices(IgnoreIndices.fromString(request.param("ignore_indices")));
+ }
return searchRequest;
}

0 comments on commit 33e7d76

Please sign in to comment.