# Need help to correctly perform wildcard search on a field

**URL:** https://discuss.elastic.co/t/need-help-to-correctly-perform-wildcard-search-on-a-field/216746
**Category:** Elasticsearch
**Created:** [January 28, 2020, 3:25am UTC](https://discuss.elastic.co/t/need-help-to-correctly-perform-wildcard-search-on-a-field/216746 "2020-01-28T03:25:51Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![meallhour](https://avatars.discourse-cdn.com/v4/letter/m/ccd318/32.png) [@meallhour](https://discuss.elastic.co/u/meallhour)
#### Post date: [January 28, 2020, 3:25am UTC](https://discuss.elastic.co/t/need-help-to-correctly-perform-wildcard-search-on-a-field/216746/1 "2020-01-28T03:25:51Z")

</div>

My mapping looks as below:

```
{
    "abc_history": {
        "mappings": {
            "abc-data-type": {
                "sData.Name": {
                    "full_name": "sData.Name",
                    "mapping": {
                        "Name": {
                            "type": "text",
                            "fields": {
                                "keyword": {
                                    "type": "keyword",
                                    "ignore_above": 256
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

```

I am trying to perform a wildcard search on `sData.Name` and used following query:

```
{
  "from": 0, 
  "size": 20, 
        "query": {
          "bool": {
            "must":[
              {"range": {"requestDate": { "gte": "2019-10-01T08:00:00.000Z" }}},
              {
                "wildcard": {
                  "sData.Name": "*Scream*"
                }
              }
            ]
          }
        },
        "sort": [
          { "requestDate": {"order": "desc"}}
        ]
}

```

The above query is returning empty response.  
How should I modify my query so that I can perform `wildcard search` on `sData.Name`

---

<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: [January 28, 2020, 6:50am UTC](https://discuss.elastic.co/t/need-help-to-correctly-perform-wildcard-search-on-a-field/216746/2 "2020-01-28T06:50:19Z")

</div>

Maybe try to search for `*scream*` instead.

Side note: don't do wildcard searches like this unless you don't care about the speed. As the doc says, it's slow.

---

<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: [February 25, 2020, 7:03am UTC](https://discuss.elastic.co/t/need-help-to-correctly-perform-wildcard-search-on-a-field/216746/3 "2020-02-25T07:03:24Z")

</div>

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