# Is there any way to search specific index according to time range?

**URL:** <https://discuss.elastic.co/t/is-there-any-way-to-search-specific-index-according-to-time-range/293822>\
**Category:** Elasticsearch\
**Created:** [January 9, 2022, 11:56am UTC](https://discuss.elastic.co/t/is-there-any-way-to-search-specific-index-according-to-time-range/293822 "2022-01-09T11:56:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zephery\_Wen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zephery_wen/32/124417_2.png) [@Zephery\_Wen](https://discuss.elastic.co/u/Zephery_Wen)\
**Post date:** [January 9, 2022, 11:56am UTC](https://discuss.elastic.co/t/is-there-any-way-to-search-specific-index-according-to-time-range/293822/1 "2022-01-09T11:56:11Z")

</div>

When i use aaaa-\* and limit time range to search, es will search all of index begin with aaaa index, if there any way to search specific index according to time range?  
for example:  
aaaa-\* have these index: aaaa-2022-01-01, aaaa-2022-01-02, aaaa-2022-01-03

and i have this query:

```http
GET aaaa-*/_search
{
  "query": {
    "range": {
      "date": {
        "gte": "2022-01-02 10:10:10",
        "lte": "2022-01-03 11:11:11"
      }
    }
  }
}

```

i wish es to search aaaa-2022-01-02 and aaaa-2022-01-03 without aaaa-2022-01-01

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 9, 2022, 9:29pm UTC](https://discuss.elastic.co/t/is-there-any-way-to-search-specific-index-according-to-time-range/293822/2 "2022-01-09T21:29:05Z")

</div>

Elasticsearch is able to determine which indices have matching ranges, and will skip those that don't 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:** [February 7, 2022, 2:14am UTC](https://discuss.elastic.co/t/is-there-any-way-to-search-specific-index-according-to-time-range/293822/5 "2022-02-07T02:14:32Z")

</div>

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