# Not able to query a wildcard

**URL:** <https://discuss.elastic.co/t/not-able-to-query-a-wildcard/220896>\
**Category:** Elasticsearch\
**Created:** [February 25, 2020, 4:42pm UTC](https://discuss.elastic.co/t/not-able-to-query-a-wildcard/220896 "2020-02-25T16:42:54Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![prasad98](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prasad98/32/64837_2.png) [@prasad98](https://discuss.elastic.co/u/prasad98)\
**Post date:** [February 25, 2020, 4:42pm UTC](https://discuss.elastic.co/t/not-able-to-query-a-wildcard/220896/1 "2020-02-25T16:42:54Z")

</div>

Hi, I'm trying to query a document where it has field `mapping_type` and `product.categories[0].name` field which I want to query it using a wildcard.

I tried to run the query in this way:

```auto
GET /products/_search
{
    "query": {
        "bool": {
            "must": [
                {
                    "match": {
                        "mapping_type": "house_products"
                    }
                },
                {
                    "wildcard": {
                       "product.categories[0].name": {
                           "value": "Ma*"
                       }
                    }
                }
            ]
        }
    }
}

```

But I didn't get any results. It has documents with `product.categories[0].name` starting with prefix `Ma` (verified)

How should I query the desired documents using these two fields?

---

<div class="post-metadata">

**Author:** ![prasad98](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prasad98/32/64837_2.png) [@prasad98](https://discuss.elastic.co/u/prasad98)\
**Post date:** [February 27, 2020, 8:35am UTC](https://discuss.elastic.co/t/not-able-to-query-a-wildcard/220896/2 "2020-02-27T08:35:10Z")

</div>

It would great if anyone can help me with this issue.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 27, 2020, 9:04am UTC](https://discuss.elastic.co/t/not-able-to-query-a-wildcard/220896/3 "2020-02-27T09:04:01Z")

</div>

Read [this](https://discuss.elastic.co/t/about-the-elasticsearch-category/21) and specifically the "Also be patient" part.

It's fine to answer on your own thread after 2 or 3 days (not including weekends) if you don't have an answer.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 27, 2020, 9:04am UTC](https://discuss.elastic.co/t/not-able-to-query-a-wildcard/220896/4 "2020-02-27T09:04:14Z")

</div>

Could you provide a full recreation script as described in [About the Elasticsearch category](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It will help to better understand what you are doing. Please, try to keep the example as simple as possible.

A full reproduction script will help readers to understand, reproduce and if needed fix your problem. It will also most likely help to get a faster answer.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 27, 2020, 9:04am UTC](https://discuss.elastic.co/t/not-able-to-query-a-wildcard/220896/5 "2020-02-27T09:04:52Z")

</div>

May be try `ma*` instead of `Ma*` in the meantime.

---

<div class="post-metadata">

**Author:** ![prasad98](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prasad98/32/64837_2.png) [@prasad98](https://discuss.elastic.co/u/prasad98)\
**Post date:** [February 27, 2020, 7:16pm UTC](https://discuss.elastic.co/t/not-able-to-query-a-wildcard/220896/6 "2020-02-27T19:16:23Z")

</div>

> [@dadoonet](#):
>
> May be try `ma*` instead of `Ma*` in the meantime.

This solution is not working.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 27, 2020, 7:28pm UTC](https://discuss.elastic.co/t/not-able-to-query-a-wildcard/220896/7 "2020-02-27T19:28:11Z")

</div>

Then share a full script as I asked.  
We can start from there.

---

<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:** [March 26, 2020, 7:28pm UTC](https://discuss.elastic.co/t/not-able-to-query-a-wildcard/220896/8 "2020-03-26T19:28:19Z")

</div>

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