# Wildcards on indices upgraded to Elasticsearch 6.5 don't work correctly

**URL:** https://discuss.elastic.co/t/wildcards-on-indices-upgraded-to-elasticsearch-6-5-dont-work-correctly/160788
**Category:** Elasticsearch
**Created:** [December 13, 2018, 5:10pm UTC](https://discuss.elastic.co/t/wildcards-on-indices-upgraded-to-elasticsearch-6-5-dont-work-correctly/160788 "2018-12-13T17:10:20Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![lcremonesi](https://avatars.discourse-cdn.com/v4/letter/l/e79b87/32.png) [@lcremonesi](https://discuss.elastic.co/u/lcremonesi)
#### Post date: [December 13, 2018, 5:10pm UTC](https://discuss.elastic.co/t/wildcards-on-indices-upgraded-to-elasticsearch-6-5-dont-work-correctly/160788/1 "2018-12-13T17:10:20Z")

</div>

We performed a rolling upgrade from Elasticsearch 5.6.7 to 6.5.0 (following the instructions reported on [this page](https://www.elastic.co/guide/en/elasticsearch/reference/6.5/rolling-upgrades.html)), without re-indexing any existing index.  
After this upgrade, when you execute a search using a query string query with wildcards on any upgraded index, the results are incorrect:

1. A question mark wildcard always returns all the documents;
2. A star wildcard returns all the documents unless it is post-fixed.

For example, searching for _serv?r_ or _?erver_ or _serve?_ returns all the documents of the index; searching for _serv\*r_ or _\*erver_ returns again all the documents of the index.

Is this a known bug of Elasticsearch 6.5?  
What are the possible workarounds for this issue? Re-indexing all the indices?

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [December 17, 2018, 12:07pm UTC](https://discuss.elastic.co/t/wildcards-on-indices-upgraded-to-elasticsearch-6-5-dont-work-correctly/160788/2 "2018-12-17T12:07:12Z")

</div>

Can you show an example query?

---

<div class="post-metadata">

### Author: ![lcremonesi](https://avatars.discourse-cdn.com/v4/letter/l/e79b87/32.png) [@lcremonesi](https://discuss.elastic.co/u/lcremonesi)
#### Post date: [December 17, 2018, 3:32pm UTC](https://discuss.elastic.co/t/wildcards-on-indices-upgraded-to-elasticsearch-6-5-dont-work-correctly/160788/3 "2018-12-17T15:32:17Z")

</div>

For example, even using a simple URI search as the following one:  
`GET http://localhost:9200/alerts/_search?q=serv*r`  
it matches all the documents of the index _alerts_ that was upgraded from 5.6.7 to 6.5.0 without re-indexing.

---

<div class="post-metadata">

### Author: ![lcremonesi](https://avatars.discourse-cdn.com/v4/letter/l/e79b87/32.png) [@lcremonesi](https://discuss.elastic.co/u/lcremonesi)
#### Post date: [December 20, 2018, 8:55pm UTC](https://discuss.elastic.co/t/wildcards-on-indices-upgraded-to-elasticsearch-6-5-dont-work-correctly/160788/4 "2018-12-20T20:55:26Z")

</div>

For now, I have resolved this issue by re-indexing all the indices created in Elasticsearch 5.6.7.

---

<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 17, 2019, 9:00pm UTC](https://discuss.elastic.co/t/wildcards-on-indices-upgraded-to-elasticsearch-6-5-dont-work-correctly/160788/5 "2019-01-17T21:00:56Z")

</div>

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