# Returning values from an update script

**URL:** <https://discuss.elastic.co/t/returning-values-from-an-update-script/15390>\
**Category:** Elasticsearch\
**Created:** [January 24, 2014, 12:40am UTC](https://discuss.elastic.co/t/returning-values-from-an-update-script/15390 "2014-01-24T00:40:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Winterstein](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/daniel_winterstein/32/1442_2.png) [@Daniel\_Winterstein](https://discuss.elastic.co/u/Daniel_Winterstein)\
**Post date:** [January 24, 2014, 12:40am UTC](https://discuss.elastic.co/t/returning-values-from-an-update-script/15390/1 "2014-01-24T00:40:34Z")

</div>

Hello,

I'm running an update request using a script. How can I return values from  
that?

Specifically, I want to return true/false based on what update the script  
has done.

Thank you &  
Best regards,

- Daniel

--  
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+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/cffb6275-cb99-444a-acbf-50e8ed724990%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/cffb6275-cb99-444a-acbf-50e8ed724990%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [January 27, 2014, 10:17am UTC](https://discuss.elastic.co/t/returning-values-from-an-update-script/15390/2 "2014-01-27T10:17:48Z")

</div>

Hey,

you can return fields from the update response (even the whole source), see  
the end of

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

You could then compare on the application side, if something had changed.  
Does that help?

--Alex

On Fri, Jan 24, 2014 at 1:40 AM, Daniel Winterstein \<  
[daniel.winterstein@gmail.com](mailto:daniel.winterstein@gmail.com)\> wrote:

> Hello,
> 
> I'm running an update request using a script. How can I return values from  
> that?
> 
> Specifically, I want to return true/false based on what update the script  
> has done.
> 
> Thank you &  
> Best regards,
> 
> - Daniel
> 
> --  
> 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+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/cffb6275-cb99-444a-acbf-50e8ed724990%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/cffb6275-cb99-444a-acbf-50e8ed724990%40googlegroups.com)  
> .  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAGCwEM\_xJCWFwA25cs8ktforfMDh9khx22mNArPFr6xxJ4fs0w%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGCwEM_xJCWFwA25cs8ktforfMDh9khx22mNArPFr6xxJ4fs0w%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Daniel\_Winterstein](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/daniel_winterstein/32/1442_2.png) [@Daniel\_Winterstein](https://discuss.elastic.co/u/Daniel_Winterstein)\
**Post date:** [January 27, 2014, 10:44am UTC](https://discuss.elastic.co/t/returning-values-from-an-update-script/15390/3 "2014-01-27T10:44:38Z")

</div>

Thanks Alexander.  
fields might be exactly what I need.  
Do you know what happens if there is a race / conflict-and-retry situation?

Will the field values returned for a request always be the ones set by that  
request?  
Or can you do an update, but get a returned value which comes from a  
different but concurrent update?

Thank you for your time & help,

- Daniel

On 27 January 2014 10:17, Alexander Reelsen [alr@spinscale.de](mailto:alr@spinscale.de) wrote:

> Hey,
> 
> you can return fields from the update response (even the whole source),  
> see the end of  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-update.html)  
> You could then compare on the application side, if something had changed.  
> Does that help?
> 
> --Alex
> 
> On Fri, Jan 24, 2014 at 1:40 AM, Daniel Winterstein \<  
> [daniel.winterstein@gmail.com](mailto:daniel.winterstein@gmail.com)\> wrote:
> 
> > Hello,
> > 
> > I'm running an update request using a script. How can I return values  
> > from that?
> > 
> > Specifically, I want to return true/false based on what update the script  
> > has done.
> > 
> > Thank you &  
> > Best regards,
> > 
> > - Daniel
> > 
> > --  
> > 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+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).
> > 
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/cffb6275-cb99-444a-acbf-50e8ed724990%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/cffb6275-cb99-444a-acbf-50e8ed724990%40googlegroups.com)  
> > .  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/JeOQUtO1G1E/unsubscribe](https://groups.google.com/d/topic/elasticsearch/JeOQUtO1G1E/unsubscribe).  
> To unsubscribe from this group and all its topics, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/CAGCwEM\_xJCWFwA25cs8ktforfMDh9khx22mNArPFr6xxJ4fs0w%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGCwEM_xJCWFwA25cs8ktforfMDh9khx22mNArPFr6xxJ4fs0w%40mail.gmail.com)  
> .
> 
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
Dr Daniel Winterstein  
Director

A: TechCube, Edinburgh, EH9 1PL  
M: +44 (0)772 5172 612  
[http://winterwell.com](http://winterwell.com)[http://sodash.com](http://sodash.com)

--  
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+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEmLSt%3DJq%3D0vFhrKoR8b1qnVx2eaiXhqMAdy3s29dD65W%3D94Mg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEmLSt%3DJq%3D0vFhrKoR8b1qnVx2eaiXhqMAdy3s29dD65W%3D94Mg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:54am UTC](https://discuss.elastic.co/t/returning-values-from-an-update-script/15390/4 "2017-07-06T01:54:38Z")

</div>


