Thanks this is working
On Tuesday, October 28, 2014 8:40:12 AM UTC+5:30, shar...@gmail.com wrote:
>
>
> "script": "removeObjects = new java.util.ArrayList(); foreach (item :
> ctx._source.list) {if (item['tweet_id'] == tweet_id)
> {removeObjects.add(item) } }
> for(removeObject:removeObjects){c
"script": "removeObjects = new java.util.ArrayList(); foreach (item :
ctx._source.list) {if (item['tweet_id'] == tweet_id)
{removeObjects.add(item) } }
for(removeObject:removeObjects){ctx._source.list.remove(removeObject);}",
2014년 10월 8일 수요일 오후 8시 12분 55초 UTC+9, Rajit Garg 님의 말:
>
> Hey
>
>
Hey
*I figured it out, I am able to update but I am not able to remove object
that satisfies the condition*
PUT twitter/twit/1
{
"list": [
{
"tweet_id": "1",
"a": "b"
},
{
"tweet_id": "123",
"a": "f"
}
]
}
POST /twitter/twit/1/_update
{
"script": "
Hi,
I have tried to update or remove the nested object in the same way as
suggested , but this is not working
I am doing this
client.update({"index": "daffosw","type": "daffo","id": "2501","body": {
"script" : "for (int i = 0; i < ctx._source.users.size(); i++){
if(ctx._source.users[i]_id =