From 04b8245d96b665ce3c353cbd0878adac049871ea Mon Sep 17 00:00:00 2001 From: kimchy Date: Tue, 19 Jul 2011 23:42:42 +0300 Subject: [PATCH] IndicesExistsRequest throws IndexMissingException, closes #1133. --- .../admin/indices/exists/TransportIndicesExistsAction.java | 3 ++- .../test/integration/document/DocumentActionsTests.java | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/indices/exists/TransportIndicesExistsAction.java b/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/indices/exists/TransportIndicesExistsAction.java index 6a783dca630..1bdf3d74c66 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/indices/exists/TransportIndicesExistsAction.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/indices/exists/TransportIndicesExistsAction.java @@ -61,7 +61,8 @@ public class TransportIndicesExistsAction extends TransportMasterNodeOperationAc } @Override protected void doExecute(IndicesExistsRequest request, ActionListener listener) { - request.indices(clusterService.state().metaData().concreteIndices(request.indices())); + // don't call this since it will throw IndexMissingException + //request.indices(clusterService.state().metaData().concreteIndices(request.indices())); super.doExecute(request, listener); } diff --git a/modules/test/integration/src/test/java/org/elasticsearch/test/integration/document/DocumentActionsTests.java b/modules/test/integration/src/test/java/org/elasticsearch/test/integration/document/DocumentActionsTests.java index d81a920db35..d297ecae8b5 100644 --- a/modules/test/integration/src/test/java/org/elasticsearch/test/integration/document/DocumentActionsTests.java +++ b/modules/test/integration/src/test/java/org/elasticsearch/test/integration/document/DocumentActionsTests.java @@ -125,6 +125,10 @@ public class DocumentActionsTests extends AbstractNodesTests { IndicesExistsResponse indicesExistsResponse = client1.admin().indices().prepareExists(getConcreteIndexName()).execute().actionGet(); assertThat(indicesExistsResponse.exists(), equalTo(true)); + logger.info("--> index exists?, fake index"); + indicesExistsResponse = client1.admin().indices().prepareExists("test1234565").execute().actionGet(); + assertThat(indicesExistsResponse.exists(), equalTo(false)); + logger.info("Clearing cache"); ClearIndicesCacheResponse clearIndicesCacheResponse = client1.admin().indices().clearCache(clearIndicesCacheRequest("test")).actionGet(); assertThat(clearIndicesCacheResponse.successfulShards(), equalTo(10));