Update an Elasticsearch document's array field without using scripting

I'm trying to add new values to an existing array field in a document. I've
noticed that using the update api just overwrites the entire array field.
So far all the examples I have found are using scripting but I can't do
that because of security. Adding the script in the config/script folder as
per http://www.elasticsearch.org/blog/scripting-security/ is not ideal
because that would mean I would be required to manually place the script in
wherever our ES instances would be installed, which could be alot of
places.

I'm actually using the Apache HttpClient to make http calls for GET and
POST etc., and a way around this is to make multiple requests in order to
get the existing array, update it from Java code, and then send a request
with the updated array. However I do not like this approach as I end up
making more than one request. I do not want to use the Java API for this
(even if there is a way).

Is there some other way to do this?

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/e7f5a2ad-2e0b-4686-b90d-e0d5c6fb720c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Just another note. A sequence of GET and POST can cause concurrency issues
if more than one of our application nodes are communicating with the ES
instance, if they try update at the same/similar time, so this is really
not ideal.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/ae21ee86-0af5-4ed7-9898-351834edc91c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

The current default scripting language, groovy, is sandboxed. If you still
don't want to use it your only option is the get update put sequence.
On Jan 19, 2015 1:29 PM, "Jason Lee" pump.mini90@gmail.com wrote:

I'm trying to add new values to an existing array field in a document.
I've noticed that using the update api just overwrites the entire array
field. So far all the examples I have found are using scripting but I can't
do that because of security. Adding the script in the config/script folder
as per Elasticsearch Platform — Find real-time answers at scale | Elastic is not ideal
because that would mean I would be required to manually place the script in
wherever our ES instances would be installed, which could be alot of
places.

I'm actually using the Apache HttpClient to make http calls for GET and
POST etc., and a way around this is to make multiple requests in order to
get the existing array, update it from Java code, and then send a request
with the updated array. However I do not like this approach as I end up
making more than one request. I do not want to use the Java API for this
(even if there is a way).

Is there some other way to do this?

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/e7f5a2ad-2e0b-4686-b90d-e0d5c6fb720c%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/e7f5a2ad-2e0b-4686-b90d-e0d5c6fb720c%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAPmjWd22B7%2B0%2B8mcMQCqtnWcfxZ1uxp6jzLDAiEa83EkFO_dJg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ah ok, so I don't have to worry about any security risks then if I just use
the defaults?

On Thursday, January 22, 2015 at 10:50:32 AM UTC+13, Nikolas Everett wrote:

The current default scripting language, groovy, is sandboxed. If you still
don't want to use it your only option is the get update put sequence.
On Jan 19, 2015 1:29 PM, "Jason Lee" <pump....@gmail.com <javascript:>>
wrote:

I'm trying to add new values to an existing array field in a document.
I've noticed that using the update api just overwrites the entire array
field. So far all the examples I have found are using scripting but I can't
do that because of security. Adding the script in the config/script folder
as per Elasticsearch Platform — Find real-time answers at scale | Elastic is not
ideal because that would mean I would be required to manually place the
script in wherever our ES instances would be installed, which could be alot
of places.

I'm actually using the Apache HttpClient to make http calls for GET and
POST etc., and a way around this is to make multiple requests in order to
get the existing array, update it from Java code, and then send a request
with the updated array. However I do not like this approach as I end up
making more than one request. I do not want to use the Java API for this
(even if there is a way).

Is there some other way to do this?

--
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 elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/e7f5a2ad-2e0b-4686-b90d-e0d5c6fb720c%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/e7f5a2ad-2e0b-4686-b90d-e0d5c6fb720c%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/4cbdb372-a04c-4216-be98-db090d8aeddb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.