From ffcc78ca0423a6b583ba3a0bbb9aefede9d804c8 Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Thu, 21 Aug 2014 11:39:59 -0700 Subject: [PATCH] Add back string op type to IndexRequest This was removed by accident I think, and it breaks backward comp. on the Java API in minor 1.3 version closes #7387 --- .../org/elasticsearch/action/index/IndexRequest.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/org/elasticsearch/action/index/IndexRequest.java b/src/main/java/org/elasticsearch/action/index/IndexRequest.java index 2b7c27f26c6..2d13803ec20 100644 --- a/src/main/java/org/elasticsearch/action/index/IndexRequest.java +++ b/src/main/java/org/elasticsearch/action/index/IndexRequest.java @@ -483,6 +483,15 @@ public class IndexRequest extends ShardReplicationOperationRequest return this; } + /** + * Sets a string representation of the {@link #opType(org.elasticsearch.action.index.IndexRequest.OpType)}. Can + * be either "index" or "create". + */ + public IndexRequest opType(String opType) throws ElasticsearchIllegalArgumentException { + return opType(OpType.fromString(opType)); + } + + /** * Set to true to force this index to use {@link OpType#CREATE}. */