# Wildcard in aggregation acting Funny

**URL:** <https://discuss.elastic.co/t/wildcard-in-aggregation-acting-funny/253616>\
**Category:** Elasticsearch\
**Created:** [October 28, 2020, 8:35pm UTC](https://discuss.elastic.co/t/wildcard-in-aggregation-acting-funny/253616 "2020-10-28T20:35:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![katana\_handler](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/katana_handler/32/77965_2.png) [@katana\_handler](https://discuss.elastic.co/u/katana_handler)\
**Post date:** [October 28, 2020, 8:35pm UTC](https://discuss.elastic.co/t/wildcard-in-aggregation-acting-funny/253616/1 "2020-10-28T20:35:05Z")

</div>

My docs (movies) are in this kind of format:

```auto
{
    "title" : "title of movie",
    "cast": [list of names],
    "genres": [list of genres],
    "year" : long
}

```

Now i have attached the query that i performed and the results it showed me. and it seems the wildcard is not working properly. for example when searching for names ending with "rell"  
i used "\*rell" in wildcard but it returned name that did not end with rell !  
Please help  
Thanks

 ![wild card acting funny](https://us1.discourse-cdn.com/elastic/original/3X/a/4/a4c825a398540cd27c25a7d7771b80cfe0c2f016.png)

you can see in the bottom left the name janet gaynor also appeared !

---

<div class="post-metadata">

**Author:** ![wangqinghuan](https://avatars.discourse-cdn.com/v4/letter/w/d26b3c/32.png) [@wangqinghuan](https://discuss.elastic.co/u/wangqinghuan)\
**Post date:** [October 30, 2020, 6:17am UTC](https://discuss.elastic.co/t/wildcard-in-aggregation-acting-funny/253616/2 "2020-10-30T06:17:09Z")

</div>

The reason is cast array(or list) is stored as a single document. You can split the array into multiple individual documents or use [parent-child join](https://www.elastic.co/guide/en/elasticsearch/reference/current/parent-join.html).

---

<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:** [November 27, 2020, 6:17am UTC](https://discuss.elastic.co/t/wildcard-in-aggregation-acting-funny/253616/3 "2020-11-27T06:17:15Z")

</div>

Closed on November 27, 2020, 6:17am UTC

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