# Wildcard not working

**URL:** <https://discuss.elastic.co/t/wildcard-not-working/344370>\
**Category:** Kibana\
**Created:** [October 4, 2023, 9:54am UTC](https://discuss.elastic.co/t/wildcard-not-working/344370 "2023-10-04T09:54:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yash\_gehi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yash_gehi/32/126247_2.png) [@yash\_gehi](https://discuss.elastic.co/u/yash_gehi)\
**Post date:** [October 4, 2023, 9:54am UTC](https://discuss.elastic.co/t/wildcard-not-working/344370/1 "2023-10-04T09:54:12Z")

</div>

```auto
{
	"query":{
		"wildcard":{
			"id": "C0*"
		}
	}
}

```

I'm trying to run a get request through postman using this as a json body. there is around 44k entries with this id. But when I run it I cannot see any data in my response body. I'm set allow expensive query to true as well.

---

<div class="post-metadata">

**Author:** ![ashishtiwari1993](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ashishtiwari1993/32/135241_2.png) [@ashishtiwari1993](https://discuss.elastic.co/u/ashishtiwari1993)\
**Post date:** [October 6, 2023, 9:23am UTC](https://discuss.elastic.co/t/wildcard-not-working/344370/2 "2023-10-06T09:23:11Z")

</div>

Hi @yash_gehi, Welcome to the Elastic community.

I assume your `id` has a type `text`. And it is not holding terms which starting with "C0\*".

For example:

### Add some documents

```auto
POST test-wildcard/_doc
{
  "id":"C0111a"
}

POST test-wildcard/_doc
{
  "id":"C0111b"
}

POST test-wildcard/_doc
{
  "id":"C0111c"
}

```

I am getting proper result for below query:

```auto
GET test-wildcard/_search?pretty
{
  "query": {
    "wildcard": {
      "id": {
        "value": "c0*"
      }
    }
  }
}

GET test-wildcard/_search?pretty
{
  "query": {
    "wildcard": {
      "id.keyword": {
        "value": "C0*"
      }
    }
  }
}

```

Here my `id` type is `text` and `id.keyword` having `keyword` type.

Similarly you can check with your mapping with below query:

```auto
GET index-name/_mappings

```

---

<div class="post-metadata">

**Author:** ![yash\_gehi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yash_gehi/32/126247_2.png) [@yash\_gehi](https://discuss.elastic.co/u/yash_gehi)\
**Post date:** [October 10, 2023, 11:24am UTC](https://discuss.elastic.co/t/wildcard-not-working/344370/3 "2023-10-10T11:24:22Z")

</div>

Thank you Ashish!

---

<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 7, 2023, 11:25am UTC](https://discuss.elastic.co/t/wildcard-not-working/344370/4 "2023-11-07T11:25:04Z")

</div>

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