# Get doc with \_id in rolling index

**URL:** <https://discuss.elastic.co/t/get-doc-with-id-in-rolling-index/211370>\
**Category:** Elasticsearch\
**Created:** [December 10, 2019, 8:12pm UTC](https://discuss.elastic.co/t/get-doc-with-id-in-rolling-index/211370 "2019-12-10T20:12:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![linkerc](https://avatars.discourse-cdn.com/v4/letter/l/13edae/32.png) [@linkerc](https://discuss.elastic.co/u/linkerc)\
**Post date:** [December 10, 2019, 8:12pm UTC](https://discuss.elastic.co/t/get-doc-with-id-in-rolling-index/211370/1 "2019-12-10T20:12:37Z")

</div>

Does anybody know how to find a document (with \_id) within rolling index?  
I cannot use wildcard in indexname.  
Do I need to search the hard index one by one?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [December 11, 2019, 8:39am UTC](https://discuss.elastic.co/t/get-doc-with-id-in-rolling-index/211370/2 "2019-12-11T08:39:17Z")

</div>

This is what wildcards are for. If you can't use them, you need to go one by one (or selecting all indices at once when executing the search).

Out of curiosity: Can you explain, why you cannot use them?

---

<div class="post-metadata">

**Author:** ![linkerc](https://avatars.discourse-cdn.com/v4/letter/l/13edae/32.png) [@linkerc](https://discuss.elastic.co/u/linkerc)\
**Post date:** [December 11, 2019, 7:13pm UTC](https://discuss.elastic.co/t/get-doc-with-id-in-rolling-index/211370/3 "2019-12-11T19:13:40Z")

</div>

Suppose my document is under  
xyz\_201911-000004/\_doc/84000beb-fe84-11e9-9ca4-34b0dd229042.

I cannot issue  
GET xyz\_201911\*/\_doc/84000beb-fe84-11e9-9ca4-34b0dd229042  
I get index\_not\_found\_exception where it treats \* as part of the index name.

It's not I don't want to use it. It's not allowed.  
Maybe I'm doing something wrong?  
This is ES7.3.1

Eventually I want to do this via High Rest API. But I believe the API takes a hard index as well.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [December 12, 2019, 8:49am UTC](https://discuss.elastic.co/t/get-doc-with-id-in-rolling-index/211370/4 "2019-12-12T08:49:33Z")

</div>

try executing a search with a query for the `_id` field instead of issuing a get operation.

---

<div class="post-metadata">

**Author:** ![linkerc](https://avatars.discourse-cdn.com/v4/letter/l/13edae/32.png) [@linkerc](https://discuss.elastic.co/u/linkerc)\
**Post date:** [December 12, 2019, 7:14pm UTC](https://discuss.elastic.co/t/get-doc-with-id-in-rolling-index/211370/5 "2019-12-12T19:14:02Z")

</div>

cool. That works. Why didn't I think of that?  
Thanks.

---

<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 9, 2020, 7:14pm UTC](https://discuss.elastic.co/t/get-doc-with-id-in-rolling-index/211370/6 "2020-01-09T19:14:20Z")

</div>

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