# Search with cluster wildcard returns data from non-matching indices

**URL:** <https://discuss.elastic.co/t/search-with-cluster-wildcard-returns-data-from-non-matching-indices/329990>\
**Category:** Elasticsearch\
**Created:** [April 14, 2023, 9:41am UTC](https://discuss.elastic.co/t/search-with-cluster-wildcard-returns-data-from-non-matching-indices/329990 "2023-04-14T09:41:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![VincentR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vincentr/32/119818_2.png) [@VincentR](https://discuss.elastic.co/u/VincentR)\
**Post date:** [April 14, 2023, 9:41am UTC](https://discuss.elastic.co/t/search-with-cluster-wildcard-returns-data-from-non-matching-indices/329990/1 "2023-04-14T09:41:24Z")

</div>

Hello,

I am currently migrating from Elastic Search 7.17.8 to 8.6.2 and I am observing a very strange change of behaviour in the search API.

Using the search REST api, when the index pattern (target) contains both

1. a cluster wildcard
2. a pattern matching no index  
the request is returning documents from other (non-matching) indexes in Elasticsearch 8.6.2 while I am expecting no result to be returned.

Example:

```auto
GET /*:invalid/_search

```

In ES 7.17.8, this returns an empty result set as expected.  
In ES 8.6.3, this returns document from my log stash (logstash-yyyy.mm.dd) indexes ?!

Is there a bug in ES 8 or am I missing something?

Note that I am observing the same issue through Kibana: I have some imported index patterns/Data views with such patterns and in the Discover, data from wrong indexes are shown instead of getting « no matching indices error » or no results.

Thank you in advance.

Vincent

---

<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:** [May 12, 2023, 9:41am UTC](https://discuss.elastic.co/t/search-with-cluster-wildcard-returns-data-from-non-matching-indices/329990/2 "2023-05-12T09:41:36Z")

</div>

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