# Find missing documents in a time series

**URL:** <https://discuss.elastic.co/t/find-missing-documents-in-a-time-series/99135>\
**Category:** Elasticsearch\
**Created:** [September 1, 2017, 1:45pm UTC](https://discuss.elastic.co/t/find-missing-documents-in-a-time-series/99135 "2017-09-01T13:45:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![redX](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/redx/32/21864_2.png) [@redX](https://discuss.elastic.co/u/redX)\
**Post date:** [September 1, 2017, 1:45pm UTC](https://discuss.elastic.co/t/find-missing-documents-in-a-time-series/99135/1 "2017-09-01T13:45:34Z")

</div>

I run a daily import of hotels with their offer count.  
The goal is to see when the offer count of a hotel "provider" changes significantly.  
If this happens, I need to know, what hotels have gone missing. My mapping:

```auto
"mappings": {
    "offer": {
        "properties": {
            "offerCount": { "type": "integer" },
            "insertDate": { "type": "date" },
            "hotelCode": {
                "type": "text",
                "fields": { "keyword": { "ignore_above": 256, "type": "keyword" } }
            },
            "provider": {
                "type": "text",
                "fields": { "keyword": { "ignore_above": 256, "type": "keyword" } }
            }
        }
    }
}

```

I am able to sum up offerCount by provider and find changes with a sequential diff.  
But I do not know how I am able to figure out what hotelCodes have been dropped from this to the last daily import.

Is this something I can do with elasticsearch, or is it simply the wrong tool for that?  
One way to achieve this would be to index all missing hotelCodes with a value of 0 for the offerCount. But it would be appreciated if this could be done by elasticsearch itself.

I am using ES 5.5.

---

<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:** [September 29, 2017, 1:46pm UTC](https://discuss.elastic.co/t/find-missing-documents-in-a-time-series/99135/2 "2017-09-29T13:46:06Z")

</div>

Closed on September 29, 2017, 1:46pm UTC

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