How to write better scripts with MVEL

Thanks a lot. Thats what I wanted. Can I know the where i can learn more
on it

Thanks ,
Arjit

On Mon, May 6, 2013 at 11:24 AM, Sujoy Sett sujoysett@gmail.com wrote:

Using a loop might help.

{
"script": "foreach(var1 : tag1) { ctx._source.remove(var1); }",
"params": {
"tag1": [
"title",
"summary",
"nextfield"
]
}
}

U can keep updating the params as per the requirement.

-- Sujoy.

On Sunday, May 5, 2013 7:21:55 PM UTC+5:30, Arjit Gupta wrote:

ctx._source.remove("title");ctx._source.remove("summary");
Works well. But I was looking for something like
ctx._source.removeAll({"title"
,"summary"});
The number of fields can be any number, I know can concat the script that
many times and it will work.

Thanks ,
Arjit

On Sun, May 5, 2013 at 4:32 PM, David Pilato da...@pilato.fr wrote:

Does something like the following work?

ctx._source.remove("title");**ctx._source.remove("summary");

HTH

David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 5 mai 2013 à 12:51, Arjit Gupta arji...@gmail.com a écrit :

ctx._source.remove("title"

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit https://groups.google.com/d/**
topic/elasticsearch/**QDVIPOpqRhw/unsubscribe?hl=en-**UShttps://groups.google.com/d/topic/elasticsearch/QDVIPOpqRhw/unsubscribe?hl=en-US
.
To unsubscribe from this group and all its topics, send an email to
elasticsearc...@**googlegroups.com.

For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
.

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/QDVIPOpqRhw/unsubscribe?hl=en-US
.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.