# Elasticsearch Troubleshooting - Missing Documents

**URL:** <https://discuss.elastic.co/t/elasticsearch-troubleshooting-missing-documents/355910>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [March 21, 2024, 2:40pm UTC](https://discuss.elastic.co/t/elasticsearch-troubleshooting-missing-documents/355910 "2024-03-21T14:40:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jgeek](https://avatars.discourse-cdn.com/v4/letter/j/51bf81/32.png) [@jgeek](https://discuss.elastic.co/u/jgeek)\
**Post date:** [March 21, 2024, 2:40pm UTC](https://discuss.elastic.co/t/elasticsearch-troubleshooting-missing-documents/355910/1 "2024-03-21T14:40:58Z")

</div>

We are running elasticsearch 8.12.2 through docker-compose. We are seeing a weird issue where some documents are missing in elasticsearch. One of the third party java spring boot application (zeebe) exports its records to elasticsearch. While all of its records are pushed to elasticsearch through the elasticsearch java client, only some records are seen when queried through the elasticsearch REST api. The REST api queries all indexes and searches through all indexes. Some records are indeed seen in the response but some are missing.

We debugged the java application and confirmed that there are no filters applied and we did see that the code does call `client.index()` method for all records. The records are for some reason missing in elasticsearch.

I enabled TRACE log level for elasticsearch container but that didn't gave any insights.

Any hints/tips for troubleshooting this further to see what's going wrong?

**REST API to query data**

```curl
curl --location --request GET 'http://localhost:9200/zeebe-record_process-instance_*,zeebe-record_job_*,zeebe-record_process-event_*,zeebe-record_process_*,zeebe-record_process-instance-creation_*,zeebe-record_job-batch_*,zeebe-record_deployment_*,zeebe-record_process_*,/_search' \
--header 'Content-Type: application/json' \
--data '{
  "query": {
    "term": {
      "value.processInstanceKey": "2251799813685249"
    }
  }
}'

```

Thanks.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [March 24, 2024, 8:10am UTC](https://discuss.elastic.co/t/elasticsearch-troubleshooting-missing-documents/355910/2 "2024-03-24T08:10:36Z")

</div>

Does the code check the responses coming back from Elasticsearch and log any failures? One thing that can cause documents to fail indexing is mapping conflicts, and Elasticsearch would indicate this in the request response. Nothing would go into the Elasticsearch logs though.

If you have a document that failed to get indexed you can always try to index it manually using e.g. curl or the Kibana dev console, and see if it fails.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 21, 2024, 8:11am UTC](https://discuss.elastic.co/t/elasticsearch-troubleshooting-missing-documents/355910/3 "2024-04-21T08:11:04Z")

</div>

Closed on April 21, 2024, 8:11am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
