DBAtlas · Database operations atlas

document_missing_exception: document_missing_exception: [_doc][id]: document missing

Elasticsearch

What does it mean?

The document to be updated (_update) was not found in the index. An update requires an existing document; if the document does not exist, this exception occurs.

Why does it happen?

The document was deleted earlier, was never created, the wrong _id was used, the request went to the wrong index, or a document written with custom routing was accessed without routing. (GET and _update are real-time; refresh delay does not cause this error.)

How to fix it

Verify that the _id and target index are correct: GET /index-name/_doc/id. If you want update-if-exists/create-if-missing behavior, use upsert (or doc_as_upsert:true) in the _update request. Create the document directly with index (PUT). In the application, catch this exception and fall back to upsert logic.

Open in DBAtlas →

More from this engine