Update multiple docs based on a query


(feridcelik) #1

Hey all,

Is it possible to update documents based on a query, simialar to mongodb update query.
I mean, smt like:
{
query: {
bool: {
must: [
{
term: {
text: "apple"
}
}
]
}
},
update:{
set: {
tag : "fruit"
}
}
}
I can query first, than update each doc with its id, but it takes too long. There should be a better solution.

Thanks.


(Benjamin Dev├Ęze) #2

Update by query is not implemented yet but there is an opened issue
for it https://github.com/elasticsearch/elasticsearch/issues/1607

On Sat, Jun 16, 2012 at 11:03 AM, feridcelik feridcelik@gmail.com wrote:

Hey all,

Is it possible to update documents based on a query, simialar to mongodb
update query.
I mean, smt like:
{
query: {
bool: {
must: [
{
term: {
text: "apple"
}
}
]
}
},
update:{
set: {
tag : "fruit"
}
}
}
I can query first, than update each doc with its id, but it takes too long.
There should be a better solution.

Thanks.

--
View this message in context: http://elasticsearch-users.115913.n3.nabble.com/Update-multiple-docs-based-on-a-query-tp4019410.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.

--
Benjamin DEVEZE


(system) #3