# Shards skip on range query

**URL:** <https://discuss.elastic.co/t/shards-skip-on-range-query/148680>\
**Category:** Elasticsearch\
**Created:** [September 14, 2018, 9:09pm UTC](https://discuss.elastic.co/t/shards-skip-on-range-query/148680 "2018-09-14T21:09:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimyoo](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@jimyoo](https://discuss.elastic.co/u/jimyoo)\
**Post date:** [September 14, 2018, 9:09pm UTC](https://discuss.elastic.co/t/shards-skip-on-range-query/148680/1 "2018-09-14T21:09:04Z")

</div>

Based on [this thread](https://discuss.elastic.co/t/are-shards-skipped-when-a-range-query-does-not-create-hits/120239), I am testing range queries to see skipping shards but the result is not I expected.

I have 2 indices (5 shards each with 0 replica); "event-1" and "event-2" where "event-1" has 4 documents whose "created (date type)" are from 1536943171000 to 1536946771000 and "event-2" has from 1536946772000 to 1536946780000.  
With a query like under, I expected see "skipped" 5 shards but 0 and all 4 hits from event-1.

```
POST event-*/_search
{       
  "size": 10, 
  "query": {
    "range": {
      "created": {
        "gte": 1536943171000, 
        "lte": 1536946771000  
      } 
    }   
  }     
} 

{
  "took": 2,
  "timed_out": false,
  "_shards": {
    "total": 10,
    "successful": 10,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": 4,
    "max_score": 1,
    "hits": [
      {
        "_index": "event-1",

```

Can you please let me know what I need to check or understand?  
I have tested with Elasticsearch version 5.6 and 6.2 and results are same.

---

<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:** [October 12, 2018, 9:12pm UTC](https://discuss.elastic.co/t/shards-skip-on-range-query/148680/2 "2018-10-12T21:12:52Z")

</div>

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