Ap1
(Ap)
February 9, 2015, 10:57pm
1
I need to update tags in docs based on query search. I am able to do it
using the update by query plugin.
Is there a way to do it using Python or Java API client.
Here is the query that works perfectly fine. Search for a phrase and update
a tag.
curl -XPOST 'localhost:9200/index/type/_update_by_query' -d '{
"query" : { "match_phrase" : { "content" : "michael aronstein" } },
"script" : "ctx._source.tags += tag",
"params" : {
"tag" : "ABC"
}
}'
Amay
--
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/b755711b-16e8-41e1-98b6-38f16b8b2031%40googlegroups.com .
For more options, visit https://groups.google.com/d/optout .
dadoonet
(David Pilato)
February 10, 2015, 5:55am
2
If you add the plugin to your Java project you can probably use https://github.com/yakaz/elasticsearch-action-updatebyquery/blob/master/src/main/java/org/elasticsearch/client/UpdateByQueryClientWrapper.java
--
David
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
Le 9 févr. 2015 à 23:57, Ap usc90909@gmail.com a écrit :
I need to update tags in docs based on query search. I am able to do it using the update by query plugin.
Is there a way to do it using Python or Java API client.
Here is the query that works perfectly fine. Search for a phrase and update a tag.
curl -XPOST 'localhost:9200/index/type/_update_by_query' -d '{
"query" : { "match_phrase" : { "content" : "michael aronstein" } },
"script" : "ctx._source.tags += tag",
"params" : {
"tag" : "ABC"
}
}'
Amay
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/b755711b-16e8-41e1-98b6-38f16b8b2031%40googlegroups.com .
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/A838211A-5B81-427F-8C99-5B1087B714F2%40pilato.fr .
For more options, visit https://groups.google.com/d/optout .