Graph Synonym search case sensitive

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"

    ]

}

}

I think you should pay atention to the filters order

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

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

1 Like

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

Best
Sagar

1 Like

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