0
I basically have the following function:
this.es.update({
index: 'contentman',
type: 'sites',
id: "_id",
body: {
name: form.value.name,
description: form.value.description,
url: form.value.url,
author: form.value.author,
data_altered: new Date().toLocaleString()
}
}).then((hits) => {
console.log(hits);
alert('Site Editado, veja o log para mais informações');
this.siteEdited(true);
When using a function that adds to the index everything works correctly:
addToIndex(value): any {
return this.client.index(value);
}
But using the update ES function:
update(value): any {
return this.client.update(value);
}
The POST
returns the following errors in the console:
RACE: 2019-05-09T11:39:24Z
-> POST http://localhost:9200/contentman/sites/id/_update
{
"name": "nomeAtualizado...",
"description": "",
"data_altered": "09/05/2019 08:39:24"
}
<- 400
{
"error": {
"root_cause": [
{
"type": "action_request_validation_exception",
"reason": "Validation Failed: 1: script or doc is missing;"
}
],
"type": "action_request_validation_exception",
"reason": "Validation Failed: 1: script or doc is missing;"
},
"status": 400
}