Я пытаюсь обновить объект вasticsearch, но у меня появляется следующее сообщение об ошибке:
Исключение Elasticsearch [type = mapper_parsing_exception, причина = сопоставление объекта для [errorMessages] пыталисьразбирать поле [errorMessages] как объект, но нашел конкретное значение]
This is my mappings:
{
.hierarchies: {
mappings: {
hierarchy: {
dynamic: "strict",
_all: {
enabled: false
},
properties: {
errorFlag: {
type: "keyword"
},
errorMessages: {
properties: {
isFavourite: {
type: "text"
},
message: {
type: "text"
}
}
},
}
}
}
И информация, которую я пытаюсь обновить, такова:
"errorMessages" -> "{"isFavourite":"yes","message":"hola"}"
Я используюоставшийся клиентский соединитель и объект UpdateRequest:
UpdateRequest updateRequest = new UpdateRequest(
collection,
type,
id);
updateRequest.doc(document);
updateRequest.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE);
try {
return esConnector.getRestClient().update(
updateRequest, RequestOptions.DEFAULT);
} catch (IOException e) {
throw new ElasticsearchGenericException("Error updating document " + collection + " > " + type + " id: " + id + " (Reason: " + e.getMessage() + ")");
}
}
Значением документа является json с errorMessages.А это объект UpdateRequest:
update {[.hierarchies] [иерархия] [ZEqi1GkByxIcUBtfsLRV], doc_as_upsert [false], doc [index {[null] [null] [null], source [{"errorMessages": "{\" isFavourite \ ": \" yes \ ", \" message \ ": \" hola \ "}"}]}], scripted_upsert [false], detect_noop [true]}
Есть идеи о проблеме?