Hi
Say I have a list of elements like this:

PUT twitter/twit/1
{
   "list": [
           {
              "a": "b",
              "c": "d",
*              "e": "f"*
            },
            {
              "1": "2",
              "3": "4"
            }
        ]
}

And I want to change the value of "e" (currently "f") to say "new_f " such 
that the document looks like: 

{
   "list": [
           {
              "a": "b",
              "c": "d",
*              "e": "new_f"*
            },
            {
              "1": "2",
              "3": "4"
            }
        ]
}

Is there a way to do this ? Maybe in MVEL ?

Do I match on document 
           {
              "a": "b",
              "c": "d",
              "e": "f"
            }

ie if list.contains(document) { some kind of update; }  // is this possible 
?


I know MVEL is being deprecated in 1.4 however it will do for now. 

I want to use bulk request. 

I know it's possible to remove the element like this: 
bulkRequestBuilder.setScript("if (ctx._source.list.contains(document)) 
{ctx._source.list.remove(document)} }").setScriptParams etc


but is it possible to "update" a field in the document also ?

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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/da238495-7cf3-4215-a77e-2144499b8859%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to