diff options
author | Areek Zillur <areek.zillur@elasticsearch.com> | 2016-08-22 13:08:49 -0400 |
---|---|---|
committer | Areek Zillur <areek.zillur@elasticsearch.com> | 2016-08-23 10:33:37 -0400 |
commit | 80ca78479f5046f58374ed831f6b2c3d51f530f9 (patch) | |
tree | 88e15ab5cb56c2b629d9484e08e99d9f0e8daa4a /core/src/main/java/org/elasticsearch/rest/action/document | |
parent | d4dec26aa00ced5ead648881301a035272210288 (diff) |
Make bulk item-level requests implement DocumentRequest interface
Currently, bulk item requests can be any ActionRequest, this commit
restricts bulk item requests to DocumentRequest. This simplifies
handling failures during bulk requests. Additionally, a new enum
is added to DocumentRequest to represent the intended operation
to be performed by a document request. Now, index operation type
also uses the new enum to specify whether the request should
create or index a document.
Diffstat (limited to 'core/src/main/java/org/elasticsearch/rest/action/document')
-rw-r--r-- | core/src/main/java/org/elasticsearch/rest/action/document/RestIndexAction.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/src/main/java/org/elasticsearch/rest/action/document/RestIndexAction.java b/core/src/main/java/org/elasticsearch/rest/action/document/RestIndexAction.java index 6c9723b5b9..f28a98f488 100644 --- a/core/src/main/java/org/elasticsearch/rest/action/document/RestIndexAction.java +++ b/core/src/main/java/org/elasticsearch/rest/action/document/RestIndexAction.java @@ -86,7 +86,7 @@ public class RestIndexAction extends BaseRestHandler { String sOpType = request.param("op_type"); if (sOpType != null) { try { - indexRequest.opType(IndexRequest.OpType.fromString(sOpType)); + indexRequest.opType(sOpType); } catch (IllegalArgumentException eia){ try { XContentBuilder builder = channel.newErrorBuilder(); |