I have an update script that updates the contents of a nested object array 
and it works fine when everything is fine but sometimes we want to be able 
to reject an update due to invalid parameters (such as a missing mandatory 
field) and return an error.

I can set the ctx.op to none so that the _version isn't changed but that 
only really works if the version is known before the request is made. So is 
there something in ctx that can be changed so that an error response is 
returned?

Code would be something like this:

if (myparam.mandatory == null)
{
  ctx.op = "none"
  // more here to return an error response
}

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/fffca062-a2d6-441c-97c8-139d7bbabca5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to