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

Elasticsearch [1.5.2] update_by_query plugin doesn't work as expected #49

Open
manumr opened this issue Jun 30, 2016 · 1 comment
Open

Comments

@manumr
Copy link

manumr commented Jun 30, 2016

I'm fairly new to Elasticsearch so apologies if I am missing something elementary. I am trying to update a field within documents in my index.

POST test_index/_update_by_query
{
  "query": {
    "match": {
      "label": {
        "query": " checked",
        "type": "phrase"
      }
    }
  },
  "script": "ctx._source.status = 'ok'"
}

Looks like it's finding the documents, just doesn't update them. Here is the output in marvel

{
   "ok": true,
   "took": 7531,
   "total": 230954,
   "updated": 0,
   "indices": [
      {
         "test_index": {}
      }
    ]
}

I've enabled dynamic_scripting as well. Any help would be most appreciated. Thanks -

@manumr
Copy link
Author

manumr commented Jun 30, 2016

Figured out what was going on after reading through a previous issue along the sames lines. Had to add

script.disable_dynamic: false

in addition to

script.inline: true
script.indexed: true

to the .yml file. Thanks for the tip. This works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant