From a7e43005bb5c3d0d646cc9c3754137cbe118459e Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Thu, 15 Sep 2011 17:07:04 +0300 Subject: [PATCH] Rest Delete API does not honor the `version_type` parameter, closes #1337. --- .../rest/action/delete/RestDeleteAction.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/rest/action/delete/RestDeleteAction.java b/modules/elasticsearch/src/main/java/org/elasticsearch/rest/action/delete/RestDeleteAction.java index afef0ccdda0..3583b56d646 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/rest/action/delete/RestDeleteAction.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/rest/action/delete/RestDeleteAction.java @@ -29,7 +29,14 @@ import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilderString; -import org.elasticsearch.rest.*; +import org.elasticsearch.index.VersionType; +import org.elasticsearch.rest.BaseRestHandler; +import org.elasticsearch.rest.RestChannel; +import org.elasticsearch.rest.RestController; +import org.elasticsearch.rest.RestRequest; +import org.elasticsearch.rest.RestStatus; +import org.elasticsearch.rest.XContentRestResponse; +import org.elasticsearch.rest.XContentThrowableRestResponse; import org.elasticsearch.rest.action.support.RestActions; import org.elasticsearch.rest.action.support.RestXContentBuilder; @@ -59,6 +66,7 @@ public class RestDeleteAction extends BaseRestHandler { deleteRequest.listenerThreaded(false); // we don't spawn, then fork if local deleteRequest.operationThreaded(true); + deleteRequest.versionType(VersionType.fromString(request.param("version_type"), deleteRequest.versionType())); String replicationType = request.param("replication"); if (replicationType != null) {