# Index exist using wildcard

**URL:** <https://discuss.elastic.co/t/index-exist-using-wildcard/195067>\
**Category:** Elasticsearch\
**Created:** [August 13, 2019, 5:20pm UTC](https://discuss.elastic.co/t/index-exist-using-wildcard/195067 "2019-08-13T17:20:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mamadly](https://avatars.discourse-cdn.com/v4/letter/m/b9bd4f/32.png) [@mamadly](https://discuss.elastic.co/u/mamadly)\
**Post date:** [August 13, 2019, 5:20pm UTC](https://discuss.elastic.co/t/index-exist-using-wildcard/195067/1 "2019-08-13T17:20:53Z")

</div>

I am getting weird behavior when I use a wildcard, when checking if index exist or not using \<curl -I -XHEAD [http://localhost:9200/index](http://localhost:9200/index) /\> pattern. Regardless whether an index with this prefix exist or not a match is always found hence, I am always getting 200 OK  
\< curl -I -XHEAD [http://localhost:9200/random\*](http://localhost:9200/random*)  
HTTP/1.1 200 OK  
content-type: application/json; charset=UTF-8  
content-length: 2  
/\>  
there is no index that named or have a prefix "random".  
So question: Is that a bug or expected behavior?

---

<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:** [August 14, 2019, 8:26am UTC](https://discuss.elastic.co/t/index-exist-using-wildcard/195067/2 "2019-08-14T08:26:21Z")

</div>

hey,

try playing around with some indices options like mentioned at [https://www.elastic.co/guide/en/elasticsearch/reference/7.3/multi-index.html](https://www.elastic.co/guide/en/elasticsearch/reference/7.3/multi-index.html)

```auto
HEAD foo*?allow_no_indices=false

```

this might be what you are after?

--Alex

---

<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:** [September 11, 2019, 8:26am UTC](https://discuss.elastic.co/t/index-exist-using-wildcard/195067/3 "2019-09-11T08:26:43Z")

</div>

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