# WIldcard case insensitive query string

**URL:** <https://discuss.elastic.co/t/wildcard-case-insensitive-query-string/75050>\
**Category:** Elasticsearch\
**Created:** [February 14, 2017, 2:27pm UTC](https://discuss.elastic.co/t/wildcard-case-insensitive-query-string/75050 "2017-02-14T14:27:10Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![fabiocatalao](https://avatars.discourse-cdn.com/v4/letter/f/779978/32.png) [@fabiocatalao](https://discuss.elastic.co/u/fabiocatalao)\
**Post date:** [February 27, 2017, 10:08am UTC](https://discuss.elastic.co/t/wildcard-case-insensitive-query-string/75050/5 "2017-02-27T10:08:15Z")

</div>

I've solved the problem using a normalizer.

Bellow is the mapping of my index, where I've just added a "normalizer" in order to allow queries case insensitive. Also, I'm _ignoring_ accented characters on search on my mapping.

```
PUT test
{ "settings": {
    "analysis": {
      "analyzer": {
        "folding": {
          "tokenizer": "standard",
          "filter": ["lowercase", "asciifolding"]
        }
      },
      "normalizer": {
        "lowerasciinormalizer": {
          "type": "custom",
          "filter": ["lowercase", "asciifolding"]
        }
      }
    }
  },
  "mappings": {
    "_default_": {
      "dynamic_templates": [
        {
          "string_as_keyword": {
            "match_mapping_type": "string",
            "match": "*_k",
            "mapping": {
              "type": "keyword",
              "normalizer": "lowerasciinormalizer"                              
            }
          }
         }
      ]
    }
  }
}

PUT test/1/123
{
    "str_k" : "string âgáÈÒU is cool"
}

GET test/_search
{
  "query": {
    "wildcard": {
      "str_k": "*agaeou*"
    }
  }
}
```

---

_[View the full topic](https://discuss.elastic.co/t/wildcard-case-insensitive-query-string/75050)._
