# How to count up "skipped shards" in "\_shards" as query result

**URL:** <https://discuss.elastic.co/t/how-to-count-up-skipped-shards-in-shards-as-query-result/159668>\
**Category:** Elasticsearch\
**Created:** [December 6, 2018, 7:26am UTC](https://discuss.elastic.co/t/how-to-count-up-skipped-shards-in-shards-as-query-result/159668 "2018-12-06T07:26:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![junkoshimane](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/junkoshimane/32/36594_2.png) [@junkoshimane](https://discuss.elastic.co/u/junkoshimane)\
**Post date:** [December 6, 2018, 7:26am UTC](https://discuss.elastic.co/t/how-to-count-up-skipped-shards-in-shards-as-query-result/159668/1 "2018-12-06T07:26:29Z")

</div>

Hi all,

I look for the way to count up "skipped shards" in "\_shards" as query result.

The following topic is similar to mine. But nobody has commented to that topic yet.

> [@Shards skip on range query](https://discuss.elastic.co/t/shards-skip-on-range-query/148680):
>
> 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"…

Based on the following URL,  
[https://discuss.elastic.co/t/are-shards-skipped-when-a-range-query-does-not-create-hits/120239/](https://discuss.elastic.co/t/are-shards-skipped-when-a-range-query-does-not-create-hits/120239/)  
I performed the following scenario. But "skipped shards" is not counted at all.  
Would you please tell me why?

- documents and index  
Please refer to hockey index in Painless Examples at  
[https://www.elastic.co/guide/en/elasticsearch/painless/current/painless-examples.html#painless-examples](https://www.elastic.co/guide/en/elasticsearch/painless/current/painless-examples.html#painless-examples)

- search query(Obviously out of range!)

```auto
{
  "query": {
    "range": {
      "born": {
        "gte" : "2000/01/01",
        "lt" : "2005/12/31"
      }
    }
  }
}

```

- result (I don't know why "skipped shards" is 0...)

```auto
{
  "took" : 11,
  "timed_out" : false,
  "_shards" : {
    "total" : 5,
    "successful" : 5,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : 0,
    "max_score" : null,
    "hits" : []
  }
}

```

---

<div class="post-metadata">

**Author:** ![junkoshimane](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/junkoshimane/32/36594_2.png) [@junkoshimane](https://discuss.elastic.co/u/junkoshimane)\
**Post date:** [December 13, 2018, 8:10am UTC](https://discuss.elastic.co/t/how-to-count-up-skipped-shards-in-shards-as-query-result/159668/2 "2018-12-13T08:10:03Z")

</div>

none ???

---

<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:** [January 10, 2019, 8:18am UTC](https://discuss.elastic.co/t/how-to-count-up-skipped-shards-in-shards-as-query-result/159668/3 "2019-01-10T08:18:59Z")

</div>

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