# Wildcard \* is not working for my index

**URL:** <https://discuss.elastic.co/t/wildcard-is-not-working-for-my-index/201040>\
**Category:** Elasticsearch\
**Created:** [September 25, 2019, 1:17pm UTC](https://discuss.elastic.co/t/wildcard-is-not-working-for-my-index/201040 "2019-09-25T13:17:08Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dibyakanta](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@Dibyakanta](https://discuss.elastic.co/u/Dibyakanta)\
**Post date:** [September 25, 2019, 1:17pm UTC](https://discuss.elastic.co/t/wildcard-is-not-working-for-my-index/201040/1 "2019-09-25T13:17:08Z")

</div>

Hi,

I have created an index with the following mapping:

PUT abc  
{  
"mappings": {  
"type" : {  
"properties": {  
"title" : {  
"type": "text",  
"analyzer": "standard"  
}  
}  
}  
}  
}

After this I added documents to it like:  
PUT abc/type/2  
{  
"title" : "douglas adams"  
}

So now when I am searching through wildcard _, I am not getting any result. My query is  
GET abc/\_search  
{  
"query": {  
"match": {  
"title": "doug_"  
}  
}  
}

So, ideally the result should come. But I am not getting any result. Please help me and correct me where I am wrong.

Thank You.

Regards,  
Dibyakanta

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [September 25, 2019, 2:26pm UTC](https://discuss.elastic.co/t/wildcard-is-not-working-for-my-index/201040/2 "2019-09-25T14:26:02Z")

</div>

So `douglas adams` will be split into two tokens, `douglas` and `adams`. Searching for `doug` will not yield any result.

There is a variety of ways to solve this

A good start on the topic of partial matching is the definitive guide, despite being a little outdated it still explains the different concepts very well. See [https://www.elastic.co/guide/en/elasticsearch/guide/current/partial-matching.html](https://www.elastic.co/guide/en/elasticsearch/guide/current/partial-matching.html)

---

<div class="post-metadata">

**Author:** ![Dibyakanta](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@Dibyakanta](https://discuss.elastic.co/u/Dibyakanta)\
**Post date:** [September 25, 2019, 2:52pm UTC](https://discuss.elastic.co/t/wildcard-is-not-working-for-my-index/201040/3 "2019-09-25T14:52:33Z")

</div>

Hi,

I wrote a wrong query by mistake.

My updated query is :

_GET abc/\_search  
{  
"query": {  
"match": {  
"title": "doug\* "  
}  
}  
}_

I am trying to search using wild card \*. The term which I am searching is doug\*. But I am not getting any results.

Thank you.

Regards,  
Dibyakanta

---

<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:** [September 25, 2019, 5:40pm UTC](https://discuss.elastic.co/t/wildcard-is-not-working-for-my-index/201040/4 "2019-09-25T17:40:05Z")

</div>

You are using a `match` query and not a `wildcard` query. That's May be the reason.

---

<div class="post-metadata">

**Author:** ![Dibyakanta](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@Dibyakanta](https://discuss.elastic.co/u/Dibyakanta)\
**Post date:** [September 25, 2019, 6:28pm UTC](https://discuss.elastic.co/t/wildcard-is-not-working-for-my-index/201040/5 "2019-09-25T18:28:45Z")

</div>

Hi,

@dadoonet, Thank You for your reply. I tried with wildcard and its working fine.

So, my question is , Is it not possible to search terms having wild card character (for e.g _doug_\*) using match query.

Thank You.

Regards,  
Dibyakanta

---

<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:** [September 25, 2019, 6:54pm UTC](https://discuss.elastic.co/t/wildcard-is-not-working-for-my-index/201040/6 "2019-09-25T18:54:56Z")

</div>

No.

In the first place you should never use a wildcard. It's slow.  
You should prefer something like edge ngram based analyzers instead.

---

<div class="post-metadata">

**Author:** ![Dibyakanta](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@Dibyakanta](https://discuss.elastic.co/u/Dibyakanta)\
**Post date:** [September 25, 2019, 7:03pm UTC](https://discuss.elastic.co/t/wildcard-is-not-working-for-my-index/201040/7 "2019-09-25T19:03:11Z")

</div>

OK.

Thanku very much.

---

<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:** [October 23, 2019, 7:18pm UTC](https://discuss.elastic.co/t/wildcard-is-not-working-for-my-index/201040/8 "2019-10-23T19:18:27Z")

</div>

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