I have an index that supports dynamic mappings under a field of type Object
that we named custom. My doc also has other objects properties with inner
props. I attached an abbreviated mapping - notice my object for "realm"
and it's properties
POST
/test-timbr-2015.02.19/event/0f78c6b6-a30b-436e-bad7-4234654fc5bb/_update
{
"script" : "ctx._source.remove("threadid")"
}
However, when I run the script against a document that has a field nested
in a specific object graph the specified field doesn't get deleted. I'm
using dot notation as you can see, and when I run this ES comes back with a
HTTP 200 and the _version property gets incremented.
POST
/test-timbr-2015.02.19/event/0f78c6b6-a30b-436e-bad7-4234654fc5bb/_update
{
"script" : "ctx._source.remove("realm.name")"
}
How can I get inner properties like this removed via the Update API.
Nevermind folks thanks anyway. I took a look at the ES source. Each
object in the doc has it's own methods such as remove():
POST
/test-timbr-2015.02.19/event/0f78c6b6-a30b-436e-bad7-4234654fc5bb/_update
{
"script" : "ctx._source.realm.remove("name http://realm.name/")"
}
On Friday, February 20, 2015 at 10:54:30 AM UTC-5, Steve Flook wrote:
I have an index that supports dynamic mappings under a field of type
Object that we named custom. My doc also has other objects properties with
inner props. I attached an abbreviated mapping - notice my object for
"realm" and it's properties
POST
/test-timbr-2015.02.19/event/0f78c6b6-a30b-436e-bad7-4234654fc5bb/_update
{
"script" : "ctx._source.remove("threadid")"
}
However, when I run the script against a document that has a field nested
in a specific object graph the specified field doesn't get deleted. I'm
using dot notation as you can see, and when I run this ES comes back with a
HTTP 200 and the _version property gets incremented.
POST
/test-timbr-2015.02.19/event/0f78c6b6-a30b-436e-bad7-4234654fc5bb/_update
{
"script" : "ctx._source.remove("realm.name")"
}
How can I get inner properties like this removed via the Update API.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.