From 47971ac80836eafee8dc6fd82270081eba87e213 Mon Sep 17 00:00:00 2001 From: Alexander Kahn Date: Thu, 9 May 2013 16:54:55 -0400 Subject: [PATCH] Reject update request that has both script and doc --- .../java/org/elasticsearch/action/update/UpdateRequest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/org/elasticsearch/action/update/UpdateRequest.java b/src/main/java/org/elasticsearch/action/update/UpdateRequest.java index f6b88f21c91..4c96eefc18c 100644 --- a/src/main/java/org/elasticsearch/action/update/UpdateRequest.java +++ b/src/main/java/org/elasticsearch/action/update/UpdateRequest.java @@ -94,6 +94,9 @@ public class UpdateRequest extends InstanceShardOperationRequest if (script == null && doc == null) { validationException = addValidationError("script or doc is missing", validationException); } + if (script != null && doc != null) { + validationException = addValidationError("can't provide both script and doc", validationException); + } return validationException; }