# Scripted partial delete

**URL:** https://discuss.elastic.co/t/scripted-partial-delete/18290
**Category:** Elasticsearch
**Created:** [June 24, 2014, 12:46pm UTC](https://discuss.elastic.co/t/scripted-partial-delete/18290 "2014-06-24T12:46:51Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![eunever32](https://avatars.discourse-cdn.com/v4/letter/e/e68b1a/32.png) [@eunever32](https://discuss.elastic.co/u/eunever32)
#### Post date: [June 24, 2014, 12:46pm UTC](https://discuss.elastic.co/t/scripted-partial-delete/18290/1 "2014-06-24T12:46:51Z")

</div>

Hi

I want to delete just one element from a list  
Is that possible inside a script?

From the docs it only appears possible to delete the document if it  
contains an element.

The solution then I guess is to read the entire document. And delete in  
memory the relevant piece.

Then write back the remainder?

But I was hoping for a "bulk" based approach

Thanks,

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/7f92b622-beef-416e-904b-3fbe53a99839%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7f92b622-beef-416e-904b-3fbe53a99839%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![eunever32](https://avatars.discourse-cdn.com/v4/letter/e/e68b1a/32.png) [@eunever32](https://discuss.elastic.co/u/eunever32)
#### Post date: [June 24, 2014, 9:03pm UTC](https://discuss.elastic.co/t/scripted-partial-delete/18290/2 "2014-06-24T21:03:45Z")

</div>

Hello

can person confirm if script can delete an element of an array

I assume it's not possible

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/cd4fd4d5-98ea-4991-bb99-9c49038115ea%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/cd4fd4d5-98ea-4991-bb99-9c49038115ea%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![eunever32](https://avatars.discourse-cdn.com/v4/letter/e/e68b1a/32.png) [@eunever32](https://discuss.elastic.co/u/eunever32)
#### Post date: [June 29, 2014, 2:48pm UTC](https://discuss.elastic.co/t/scripted-partial-delete/18290/3 "2014-06-29T14:48:38Z")

</div>

Actually it is possible!  
It's a mvel thing

In mvel it's possible to  
\_source.doc.list.remove (elem)

The options in elasticsearch documentation do not go very deep.

Maybe another discussion group for mvel scripting questions ?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/5110d3c4-f5e4-40a5-9eda-b5235229b2b1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5110d3c4-f5e4-40a5-9eda-b5235229b2b1%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 1:19am UTC](https://discuss.elastic.co/t/scripted-partial-delete/18290/4 "2017-07-06T01:19:09Z")

</div>


