# Graph Synonym search case sensitive

**URL:** <https://discuss.elastic.co/t/graph-synonym-search-case-sensitive/264094>\
**Category:** Elasticsearch\
**Created:** [February 12, 2021, 8:28am UTC](https://discuss.elastic.co/t/graph-synonym-search-case-sensitive/264094 "2021-02-12T08:28:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sagar.pattnayak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sagar.pattnayak/32/94542_2.png) [@sagar.pattnayak](https://discuss.elastic.co/u/sagar.pattnayak)\
**Post date:** [February 12, 2021, 8:28am UTC](https://discuss.elastic.co/t/graph-synonym-search-case-sensitive/264094/1 "2021-02-12T08:28:08Z")

</div>

Hi  
I have applied graph synonym search and it is working as expected when ever I search on lowercase. However the moment i change the keyword to upper case it is not working as expected.  
For example I have the terms laptop, notebook (all lowercase) in synonyms.txt file. If i search laptop or notebook it works fine. However if I search LAPTOP / NOTEBOOK it is not returning expected result.

My requirement is to make all variant work. I have lowercase mapping enabled in the index. Any pointer is appreciated.

**Mapping**

"lowercase\_filter": {

```
"type": "lowercase"

```

},

"synonym": {

```
"type": "synonym_graph",

"synonyms_path": "analysis/synonyms.txt",

"updateable": true

```

}

"analyzer": {

```
"my_synonyms": {

    "tokenizer": "standard",

    "filter": [

        "synonym",

        "lowercase_filter"

    ]

}

```

}

---

<div class="post-metadata">

**Author:** ![ylasri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ylasri/32/86120_2.png) [@ylasri](https://discuss.elastic.co/u/ylasri)\
**Post date:** [February 12, 2021, 8:55am UTC](https://discuss.elastic.co/t/graph-synonym-search-case-sensitive/264094/2 "2021-02-12T08:55:16Z")

</div>

I think you should pay atention to the filters order

```auto
"synonym": {
"type": "synonym_graph",
"synonyms_path": "analysis/synonyms.txt",
"updateable": true
}
"analyzer": {
"my_synonyms": {
    "tokenizer": "standard",
    "filter": [
        "lowercase",
        "synonym",
    ]
}
}

```

---

<div class="post-metadata">

**Author:** ![sagar.pattnayak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sagar.pattnayak/32/94542_2.png) [@sagar.pattnayak](https://discuss.elastic.co/u/sagar.pattnayak)\
**Post date:** [February 12, 2021, 11:50am UTC](https://discuss.elastic.co/t/graph-synonym-search-case-sensitive/264094/3 "2021-02-12T11:50:13Z")

</div>

Dear @ylasri  
Thanks for a quick response. I will try this out and let you know the outcome.

---

<div class="post-metadata">

**Author:** ![sagar.pattnayak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sagar.pattnayak/32/94542_2.png) [@sagar.pattnayak](https://discuss.elastic.co/u/sagar.pattnayak)\
**Post date:** [February 16, 2021, 10:11am UTC](https://discuss.elastic.co/t/graph-synonym-search-case-sensitive/264094/4 "2021-02-16T10:11:44Z")

</div>

Dear @ylasri  
Thank you very much. The solution worked.

Best  
Sagar

---

<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:** [March 16, 2021, 10:12am UTC](https://discuss.elastic.co/t/graph-synonym-search-case-sensitive/264094/5 "2021-03-16T10:12:34Z")

</div>

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