I'm trying to update a document field but had no success doing it. I can do a GET by ID with ticket-2/ticketelastic/134532
so that clarifies that the ID is valid and the document exists.
{
"_index" : "ticket-2",
"_type" : "ticketelastic",
"_id" : "134532",
"_version" : 637672165389810000,
"_seq_no" : 183125,
"_primary_term" : 2,
"found" : true,
"_source" : {
//...
}
}
I tried it with many methods I found online, such as:
POST ticket-2/ticketelastic/_update/134532
{
"doc": {
"status": 1
}
}
Which returns:
{
"error": "no handler found for uri [ticket-2/ticketelastic/_update/134532?pretty] and method [POST]"
}
Then I tried removing the type:
POST ticket-2/_update/134532
{
"doc": {
"status": 1
}
}
Which returns:
{
"error": {
"root_cause": [
{
"type": "invalid_type_name_exception",
"reason": "Document mapping type name can't start with '_', found: [_update]"
}
],
"type": "invalid_type_name_exception",
"reason": "Document mapping type name can't start with '_', found: [_update]"
},
"status": 400
}
Then I tried to update with a script:
POST ticket-2/_doc/134532/_update
{
"script" : "ctx._source.status = 1"
}
Which returns:
{
"error" : {
"root_cause" : [
{
"type" : "document_missing_exception",
"reason" : "[_doc][134532]: document missing",
"index_uuid" : "0sWafHcDTYyYZQ2v7I_2UQ",
"shard" : "0",
"index" : "ticket-2"
}
],
"type" : "document_missing_exception",
"reason" : "[_doc][134532]: document missing",
"index_uuid" : "0sWafHcDTYyYZQ2v7I_2UQ",
"shard" : "0",
"index" : "ticket-2"
},
"status" : 404
}
Am I doing something wrong here? On my research I've seen people mention routing and whatnot, but that's not present on the metadata of my document, leading me to believe that routing is not necessary to specify. My Elasticsearch version is 6.6.1