# Why elasticsearch results are not consistant?

**URL:** https://discuss.elastic.co/t/why-elasticsearch-results-are-not-consistant/20260
**Category:** Elasticsearch
**Created:** [October 15, 2014, 7:50am UTC](https://discuss.elastic.co/t/why-elasticsearch-results-are-not-consistant/20260 "2014-10-15T07:50:03Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Xinuo\_Chen](https://avatars.discourse-cdn.com/v4/letter/x/73ab20/32.png) [@Xinuo\_Chen](https://discuss.elastic.co/u/Xinuo_Chen)
#### Post date: [October 15, 2014, 7:50am UTC](https://discuss.elastic.co/t/why-elasticsearch-results-are-not-consistant/20260/1 "2014-10-15T07:50:03Z")

</div>

I have some documents in elasticsearch.

first I do

```
{
   "sort":[
      "@timestamp"
   ],
   "query":{
      "in":{
         "action_type":[
            "start",
            "end"
         ]
      }
   },
   "size":0
}

```

I get

```
{
   "took":58,
   "timed_out":false,
   "_shards":{
      "total":5,
      "successful":5,
      "failed":0
   },
   "hits":{
      "total":24435,
      "max_score":0.0,
      "hits":[

      ]
   }
}

```

* * *

Then I want to get latest 100 document, I do

```
{
   "sort":[
      "@timestamp"
   ],
   "query":{
      "in":{
         "action_type":[
            "start",
            "end"
         ]
      }
   },
   "from":24335,
   "size":100
}

```

it returns

```
{
   "took":25,
   "timed_out":false,
   "_shards":{
      "total":5,
      "successful":5,
      "failed":0
   },
   "hits":{
      "total":18327,
      "max_score":null,
      "hits":[

      ]
   }
}

```

Basically, the 2nd query indicates the `total` has been changed.

If I do the first query again, then still get the 1st result.

Why two queries are not returning same result?

by the way, if I use `filter`, it is the same

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/36fab4b9-ad31-459e-a94d-88e9bbca4883%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/36fab4b9-ad31-459e-a94d-88e9bbca4883%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 12:56am UTC](https://discuss.elastic.co/t/why-elasticsearch-results-are-not-consistant/20260/2 "2017-07-06T00:56:08Z")

</div>


