Hi

I can append to a list as follows: 

PUT twitter/tweet/1
{
  "list": [
    {
      "tweet_id": "1",
      "a": "b"
    },
    {
      "tweet_id": "123",
      "a": "f"
    }
  ]
}

POST twitter/tweet/1/_update
{
    "script": 
    "if (!ctx._source.list.contains(newfileinfo)){ctx._source.list += 
newfileinfo}",    
    "params": {"newfileinfo": {"tweet_id": "3", "a": "g"}}
} 


When I run the second step above repeatedly the json : {"tweet_id": "3", 
"a": "g"} is not inserted which is correct.

However the version keeps changing 
"_version": 2,
"_version": 3,
"_version": 4,
"_version": 5,
etc

It is concerning me that the mvel: 
*      "if (!ctx._source.list.contains(newfileinfo)) *{

is not working (?)

And the update is happening repeatedly and maybe what's happening is the 
fragment is overwriting the document each time?

That would have performance implications ?

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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/9e615825-38dd-479c-bc7e-af5f8905b876%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to