ElasticSearch Partial Update Java API


(Vishal Kumar Singh) #1

We have a requirement where-in we have to perform partial update in ElasticSearch (version 1.4.4)DB using Java API.
We have achieved partial update using UpdateRequestBuilder.setDoc API But there is some performance issue with the above method of UpdateRequestBuilder API.

We found that we can use Script as well to partial update. But we are facing below issue while implementing Script using Java API.
Please find below the mapping details, document format in ES database, error message

a) Mapping Details:
{
"xxxx": {
"properties": {
"xxxx_id": {
"type": "string",
"index_analyzer": "text_keyword",
"search_analyzer": "text_keyword"
},
"yyyy": {
"properties": {
"yyyy_id": {
"type": "string",
"index_analyzer": "text_keyword",
"search_analyzer": "text_keyword"
},
"asset_mgr": {
"properties": {
"zzzz_id": {
"type": "string",
"index": "not_analyzed"
}
}
}
}
}
}
}
}

b) Data Present in ES JSON:
{
"_index": "indexname",
"_type": "typename",
"_id": "2181",
"_version": 1,
"_score": 1,
"_source": {
"xxxx_id": "2181",
"yyyy": {
"yyyy_id": "12345",
"zzzz_id": [
{
"company_id": null,
"company_name": null
}
]
}
}
}

c) Error Details:

  1. For some records we are getting below error message:
    object mapping for [xxxx] tried to parse field [yyyy] as object, but got EOF, has a concrete value been provided to it?

  2. For some records we are getting below error message:
    Caused by: org.elasticsearch.script.ScriptException: dynamic scripting for [groovy] disabled

Any help will be highly appreciated as we are not able to progress further.
Please let me know if any further details are required for the same.


(system) #2