Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update API: update by query #1607

Closed
monken opened this issue Jan 12, 2012 · 160 comments
Closed

Update API: update by query #1607

monken opened this issue Jan 12, 2012 · 160 comments
Labels
:Distributed/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search.

Comments

@monken
Copy link

monken commented Jan 12, 2012

#1583 allows to update individual documents. Update by query will reduce the network roundtrips radically if you want to update a number of documents and push work from the client to ES.

curl -XPOST localhost:9200/index/type/_update -d '{
    "query" : { "constant_score" : { "filter" : { "term" : { "counter" : 0 } } } },
    "script" : "ctx._source.counter += count",
    "params" : {
        "count" : 4
    }
}'
@Mpdreamz
Copy link
Member

Would really love this feature too!

@r10r
Copy link

r10r commented Jun 3, 2012

+1

3 similar comments
@darklow
Copy link

darklow commented Jun 5, 2012

+1

@mrgautamsam
Copy link

+1

@feridgurbuz
Copy link

+1

@gc20
Copy link

gc20 commented Sep 25, 2012

+1

2 similar comments
@serpent403
Copy link

+1

@devilankur18
Copy link

+1

@willtrking
Copy link

+1

4 similar comments
@ignatiusreza
Copy link

+1

@kenshin54
Copy link

+1

@noodlehaus
Copy link

+1

@Aoseala
Copy link

Aoseala commented Jan 3, 2013

+1

@timotta
Copy link

timotta commented Jan 24, 2013

I really need this feature

@burzum
Copy link

burzum commented Feb 4, 2013

👍

@ofavre
Copy link
Contributor

ofavre commented Feb 13, 2013

While waiting this feature to be officially finished and released, I've packaged the pull request #2231 as a plugin: yakaz/elasticsearch-action-updatebyquery.
Have fun.

@bobbyrenwick
Copy link

+1

6 similar comments
@geoffwatts
Copy link

+1

@AnSavvides
Copy link

+1

@neogenix
Copy link

neogenix commented Mar 4, 2013

+1

@scriby
Copy link

scriby commented Mar 4, 2013

+1

@gnurag
Copy link

gnurag commented Mar 7, 2013

+1

@damienalexandre
Copy link
Contributor

+1

@mobalytics
Copy link

+1

3 similar comments
@marioeu
Copy link

marioeu commented Sep 15, 2015

+1

@ogorun
Copy link

ogorun commented Sep 16, 2015

+1

@ron521
Copy link

ron521 commented Nov 3, 2015

+1

@Praveen82
Copy link

can some one review this and give feedback.
https://discuss.elastic.co/t/updatebyqueryresponse-throwing-timeout/29176

Update by query fails while update more then 20 + million record .

@rayward
Copy link

rayward commented Nov 3, 2015

@Praveen82 you are using a 3rd party plugin. This isn't the right place to be requesting support, you should post that as an issue on that plugin's repository.

@nik9000
Copy link
Member

nik9000 commented Dec 19, 2015

#15125 is implementing a syntax that will look a little like

curl -XPOST localhost:9200/index/type/_update_by_query -d '{
    "query" : { "term" : { "counter" : 0 } },
    "script" : {
      "inline": "ctx._source.counter += count",
      "params" : {
          "count" : 4
      }
  }
}'

The reason this was stalled for so long is because of those timeouts: up until now there has been a way to launch long running job in Elasticsearch and report on their status and things. With the task management api (#15347) eminent I picked up the torch on "reindex" and "update-by-query" style things and started them again with the intent to integrate with task management ASAP.

Anyway, #15125 and any followup PRs are the place to look for this feature.

@gepuskas
Copy link

gepuskas commented Mar 2, 2016

+1

@YuriMarinkov
Copy link

+1

@canyildiz
Copy link

+1

2 similar comments
@Digital2Slave
Copy link

+1

@yossicahen
Copy link

+1

@nik9000
Copy link
Member

nik9000 commented Apr 20, 2016

Update by query is live in 2.3.0 and 5.0.0-alpha-1. The docs are here.

@scohenenator
Copy link

Does update by query in 2.3.+ or 5.+ support the javascript plugin?

@nik9000
Copy link
Member

nik9000 commented Aug 9, 2016

Does update by query in 2.3.+ or 5.+ support the javascript plugin?

If you really want it, sure. In 2.3+ we test update-by-query against groovy and in 5.+ we test against painless. We used to test against groovy and it worked there as well. I expect javascript will work fine.

@scohenenator
Copy link

JS support would be pretty slick.

@nik9000
Copy link
Member

nik9000 commented Aug 9, 2016

JS support would be pretty slick.

As I said, it exists, you just have to install the plugin.

The trouble with all of these languages is that their implementation on the JVM aren't properly oriented for embedding. That is why we don't include it by default.

Anyway, if you want to talk more about it I think discuss.elastic.co is a more appropriate place for it.

@lcawl lcawl added :Distributed/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. and removed :Reindex API labels Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search.
Projects
None yet
Development

No branches or pull requests