Need help to correctly perform wildcard search on a field

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

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.

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