# Update by query successful but no effective change

**URL:** <https://discuss.elastic.co/t/update-by-query-successful-but-no-effective-change/88801>\
**Category:** Elasticsearch\
**Created:** [June 9, 2017, 7:36am UTC](https://discuss.elastic.co/t/update-by-query-successful-but-no-effective-change/88801 "2017-06-09T07:36:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![leogb](https://avatars.discourse-cdn.com/v4/letter/l/8baadc/32.png) [@leogb](https://discuss.elastic.co/u/leogb)\
**Post date:** [June 9, 2017, 7:36am UTC](https://discuss.elastic.co/t/update-by-query-successful-but-no-effective-change/88801/1 "2017-06-09T07:36:37Z")

</div>

Hello,

I'm trying to remove one (or more) element from a list in my index, like:  
"'\_source": {  
"id": [  
12,  
22,  
32,  
...  
]  
}

I'm using an update\_by\_query and a painless script to remove an id in the index if they match one in the given list.  
The query repond 'succes': 1 (it's applied tp one doc\_type only, I got 10 but I restricted it for debugging purpose), so I guess that my script work and it should! I remember testing it on a small list (10 elements) but not the list is 8500 element long.

Anyway, I'm using the python Elasticsearch Client v 5.1.0 (my cluster is v5.1.4)  
Here is the script:

```
                   "script": {
                        "inline":
                        """for (int i = 0; i < params.ids_list.length; ++i)"""
                        """{"""
                        """ if (ctx._source.id.contains(params.ids_list[i]))"""
                        """ {"""
                        """ ctx._source.id.remove(ctx._source.id.indexOf(params.ids_list[i]))"""
                        """ }"""
                        """}"""
                        
                        ,
                        'params': {
                            'id': ids_list
                            }
                        },
                    'query': {
                        'match_all': {}
                        }

```

Thanks for the futur replies.

---

<div class="post-metadata">

**Author:** ![leogb](https://avatars.discourse-cdn.com/v4/letter/l/8baadc/32.png) [@leogb](https://discuss.elastic.co/u/leogb)\
**Post date:** [June 9, 2017, 8:35am UTC](https://discuss.elastic.co/t/update-by-query-successful-but-no-effective-change/88801/2 "2017-06-09T08:35:57Z")

</div>

Problem found: the given list was a list of string, the index was a list of integer.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 7, 2017, 8:36am UTC](https://discuss.elastic.co/t/update-by-query-successful-but-no-effective-change/88801/3 "2017-07-07T08:36:07Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
