# Different number of documents when querying Kibana vs Elasticsearch

**URL:** <https://discuss.elastic.co/t/different-number-of-documents-when-querying-kibana-vs-elasticsearch/124613>\
**Category:** Elasticsearch\
**Created:** [March 19, 2018, 5:09pm UTC](https://discuss.elastic.co/t/different-number-of-documents-when-querying-kibana-vs-elasticsearch/124613 "2018-03-19T17:09:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kyle1441](https://avatars.discourse-cdn.com/v4/letter/k/f0a364/32.png) [@kyle1441](https://discuss.elastic.co/u/kyle1441)\
**Post date:** [March 19, 2018, 5:09pm UTC](https://discuss.elastic.co/t/different-number-of-documents-when-querying-kibana-vs-elasticsearch/124613/1 "2018-03-19T17:09:58Z")

</div>

Hi everyone,

I'm running the following query via the Kibana Dev Tools tab:

```
GET _search
{
  "query": {
    "bool": {
      "must": {
        "match":{
          "event.name":"client.player_start"
        }
      },
      "filter":{
        "range":{
          "@timestamp":{
            "gte":"2018-03-15",
            "lte":"2018-03-16"
          }
        }
      }
    }
  }
}

```

Which returns:

```
{
  "took": 51,
  "timed_out": false,
  "_shards": {
    "total": 486,
    "successful": 486,
    "failed": 0
  },
  "hits": {
    "total": 67,
    "max_score": 2.7472708,
    "hits": [
      {

```

And then it lists the 67 documents.

However when I run what I believe is exactly the same thing in Kibana's Discover tab... I get 64 documents. This discrepancy is also present when running on different timeframes, different search terms, etc. I get larger # of document discrepancies when running larger queries.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/e/2e84e6fb5d2255525778358d56dc25b05afdae57.png)

My thoughts:  
Maybe I'm screwing up my gte and lte days? Not sure.

Perhaps there is an issue here with timezones? Perhaps Kibana is using my local time (GMT-8) where the console query is using something different?

I am using Timestamp in the query and Kibana is using the "Time" field, but not sure what the time field is called, however as you can see the values are the same to the millisecond.

Thank you for your help. If you have any advice on my queries, please let me know.

This is running on version 5.5

---

<div class="post-metadata">

**Author:** ![kyle1441](https://avatars.discourse-cdn.com/v4/letter/k/f0a364/32.png) [@kyle1441](https://discuss.elastic.co/u/kyle1441)\
**Post date:** [March 19, 2018, 6:36pm UTC](https://discuss.elastic.co/t/different-number-of-documents-when-querying-kibana-vs-elasticsearch/124613/2 "2018-03-19T18:36:32Z")

</div>

Resolved:  
Looks like timezones were indeed the issue here.

My URL has  
time:(from:'2018-03-15T07:00:00.000Z',mode:absolute,to:'2018-03-17T06:59:59.000Z'))

Which shows it shifting for browser time. Adjusting the URL has made the document results match.

---

<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 16, 2018, 6:36pm UTC](https://discuss.elastic.co/t/different-number-of-documents-when-querying-kibana-vs-elasticsearch/124613/3 "2018-04-16T18:36:34Z")

</div>

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