Open jpcarey opened 2 years ago
8.0.0
No response
bundled
Elastic Cloud
If _source: false is specified in the request body for an update_by_query, ctx._source will be null. This results in the underlying document data being wiped.
_source: false
ctx._source
// POST _bulk { "index" : { "_index" : "test" } } { "field1" : "some data", "doc": 1 } { "index" : { "_index" : "test" } } { "field1" : "some data2", "doc": 2 } { "index" : { "_index" : "test" } } { "field1" : "some data3", "doc": 3 } // POST test/_update_by_query { "_source": "false", "query": { "match_all": {} }, "script": { "lang": "painless", "source": "ctx._source['wiped'] = true;" } } // GET test/_search { "took" : 0, "timed_out" : false, "_shards" : { "total" : 1, "successful" : 1, "skipped" : 0, "failed" : 0 }, "hits" : { "total" : { "value" : 3, "relation" : "eq" }, "max_score" : 1.0, "hits" : [ { "_index" : "test", "_id" : "YrXQI38BBHHW5cLq9JRF", "_score" : 1.0, "_source" : { "wiped" : true } }, { "_index" : "test", "_id" : "Y7XQI38BBHHW5cLq9JRF", "_score" : 1.0, "_source" : { "wiped" : true } }, { "_index" : "test", "_id" : "ZLXQI38BBHHW5cLq9JRF", "_score" : 1.0, "_source" : { "wiped" : true } } ] } }
Pinging @elastic/es-data-management (Team:Data Management)
Elasticsearch Version
8.0.0
Installed Plugins
No response
Java Version
bundled
OS Version
Elastic Cloud
Problem Description
If
_source: false
is specified in the request body for an update_by_query,ctx._source
will be null. This results in the underlying document data being wiped.Steps to Reproduce
Logs (if relevant)
No response