-> id source – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 2.3-2.3

Briefly, this error occurs when Elasticsearch cannot find the specified ID in the source document. This could be due to a missing or incorrect ID field in the document. To resolve this issue, you can check the document to ensure the ID field is present and correctly named. If the ID field is missing, you need to add it. If it’s incorrectly named, you need to rename it. Also, ensure that the ID value is unique and correctly formatted.

This guide will help you check for common problems that cause the log ” -> id [{}]; _source [{}] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: aggregations.

Log Context

Log “-> id [{}]; _source [{}]” classname is tophits-aggregation.asciidoc.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

     logger.info("key [{}]; doc_count [{}]"; key; docCount);

    // We ask for top_hits for each bucket
    TopHits topHits = entry.getAggregations().get("top");
    for (SearchHit hit : topHits.getHits().getHits()) {
        logger.info(" -> id [{}]; _source [{}]"; hit.getId(); hit.getSourceAsString());

This will basically produce for the first example:


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?