Document not found index type id – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 6.8-7.17

Briefly, this error occurs when Elasticsearch tries to access a document using its index, type, and id, but the document does not exist. This could be due to the document being deleted, the index not being created, or the id being incorrect. To resolve this issue, you can verify the existence of the document by using the ‘GET’ API with the correct index and id. If the document doesn’t exist, you may need to recreate it. If the index doesn’t exist, you’ll need to create it. Lastly, ensure the id you’re using is correct.

This guide will help you check for common problems that cause the log ” Document not found [” + index + “]/[” + type + “]/[” + id + “] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: document, index, rest.

Log Context

Log “Document not found [” + index + “]/[” + type + “]/[” + id + “]” class name is RestGetSourceAction.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 final String index = response.getIndex();
 final String type = response.getType();
 final String id = response.getId();  if (response.isExists() == false) {
 throw new ResourceNotFoundException("Document not found [" + index + "]/[" + type + "]/[" + id + "]");
 } else if (response.isSourceEmpty()) {
 throw new ResourceNotFoundException("Source not found [" + index + "]/[" + type + "]/[" + id + "]");
 }
 }
 }

 

How helpful was this guide?

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?