# Search for special characters

**URL:** <https://discuss.elastic.co/t/search-for-special-characters/114495>\
**Category:** Elasticsearch\
**Created:** [January 8, 2018, 10:34am UTC](https://discuss.elastic.co/t/search-for-special-characters/114495 "2018-01-08T10:34:18Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![RohanKumbhar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rohankumbhar/32/23649_2.png) [@RohanKumbhar](https://discuss.elastic.co/u/RohanKumbhar)\
**Post date:** [January 8, 2018, 1:44pm UTC](https://discuss.elastic.co/t/search-for-special-characters/114495/5 "2018-01-08T13:44:29Z")

</div>

I have used below custom analyzer

```
PUT my_index
{
  "settings": {
    "index": {
      "analysis": {
        "analyzer": {
          "custom_analyzer": {
            "type": "custom",
            "tokenizer": "my_tokenizer"
          }
        },
        "tokenizer": {
          "my_tokenizer": {
            "type": "ngram",
            "min_gram": 1,
            "max_gram": 10
          }
        }
      }
    }
  },
  "mappings": {
    "doc": {
      "properties": {
        "my_field": {
          "type": "text",
          "analyzer": "custom_analyzer",
          "fields": {
            "keyword": {
              "ignore_above": 256,
              "type": "keyword"
            }
          }
        }
      }
    }
  }
}

PUT my_index/doc/2 
{
  "my_field":"$title123.txt"
}

PUT my_index/doc/1
{
  "my_field":"$titan@123#.txt"
}

```

Here special character search is working fine but if i search for **titan** i'm getting both the documents (my\_field with **title** in it) which is irrelevant search

---

_[View the full topic](https://discuss.elastic.co/t/search-for-special-characters/114495)._
