I need to update a field in the documents indexed to Elasticsearch . How can i do it.
\"redcash_sale\": {
\"type\": \"object\"
}
update ab
According to: https://www.elastic.co/guide/en/elasticsearch/reference/current/enabled.html
Enabled cant be updated using the PUT mappings API.
You have to reindex your data then.
What you can do is to _reindex your data to a dest index, delete your original one and then _reindex again to your original one with the new mapping.
Reindex:
POST _reindex
{
"source": {
"index": "sale_property_development_j"
},
"dest": {
"index": "new_sale_property_development_j"
}
}
Delete original index:
DELETE sale_property_development_j
Create requested mapping:
PUT sale_property_development_j
{
"mappings":{
"property":{
"properties": {
"redcash_sale": {
"type": "object",
"enabled": false
}
}
}
}
}
Reindex again:
POST _reindex?wait_for_completion=false
{
"source": {
"index": "new_sale_property_development_j"
},
"dest": {
"index": "sale_property_development_j"
}
}
Finally:
DELETE new_sale_property_development_j
It's a nice to have solution