# Inconsistent results in aggregations (Or ghost records)

**URL:** <https://discuss.elastic.co/t/inconsistent-results-in-aggregations-or-ghost-records/40918>\
**Category:** Elasticsearch\
**Created:** [February 3, 2016, 10:51pm UTC](https://discuss.elastic.co/t/inconsistent-results-in-aggregations-or-ghost-records/40918 "2016-02-03T22:51:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![javadevmtl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/javadevmtl/32/45613_2.png) [@javadevmtl](https://discuss.elastic.co/u/javadevmtl)\
**Post date:** [February 3, 2016, 10:51pm UTC](https://discuss.elastic.co/t/inconsistent-results-in-aggregations-or-ghost-records/40918/1 "2016-02-03T22:51:32Z")

</div>

Hi running 2.1.0

I'm executing this aggregation

```
GET my index/_search
{
  "size": 0,
  "aggs": {
    "by_date": {
      "date_histogram": {
        "field": "my_date",
        "interval": "day"
      }
    }
  }
}

```

The search returns ghost records. If I recall this is because the replica shards are not consistent with the primary shards?

The index is 32 shards with 1 replica. So 64 shards total.

This is supposed to be the right result.

```
  "buckets": [
    {
      "key_as_string": "2016-02-05T00:00:00.000Z",
      "key": 1454630400000,
      "doc_count": 2761324
    }
  ]

```

This is the ghost results.

```
"buckets": [
        {
          "key_as_string": "2016-02-03T00:00:00.000Z",
          "key": 1454457600000,
          "doc_count": 6494
        },
        {
          "key_as_string": "2016-02-04T00:00:00.000Z",
          "key": 1454544000000,
          "doc_count": 0
        },
        {
          "key_as_string": "2016-02-05T00:00:00.000Z",
          "key": 1454630400000,
          "doc_count": 2751324
        }
      ]
```

---

<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:** [July 5, 2017, 11:19pm UTC](https://discuss.elastic.co/t/inconsistent-results-in-aggregations-or-ghost-records/40918/2 "2017-07-05T23:19:08Z")

</div>

Closed on July 5, 2017, 11:19pm UTC


