I hava a document in Elasticsearch:
{
"_index": "test",
"_type": "document",
"_id": "1",
"_score": 1,
"_source": {
"class": "aaa",
"id": 1,
"items": [{
"class": "aaa",
"id": 1
},{
"class": "ccc",
"id": 2
}],
"lastUpdated": "2016-07-22T11:26:56Z",
"processInstance": {
"class": "bbb"
},
"bianhao": "123"
}
}
how to delete id or class of items using java?
how to delete {"class": "ccc","id": 2} using java?
I know how to delete a field,using:
client.prepareUpdate("test", "document", "1")
.setScript(new Script(
"ctx._source.remove(\"bianhao\")",
ScriptService.ScriptType.INLINE, null, null))
.get();
the content of items is json array,I have not found the method.