Make elastic treat "c#" and "c++" differently

Hello

I need elasticsearch return considerably different results when searched
for "c#" and "c++".

After going through documenation/stackoverflow and few trail and errors, I
implemented custom analyzer that will consider # and + as ALPHANUM.
Now I am getting better results. But, few of my results even now contain
"c++" WITHOUT "c#" text when searched with "c#".

Below is my analyzer:
"settings": {
"analysis": {
"filter": {
"hash_filter": {
"type": "word_delimiter",
"type_table": [
"# => ALPHANUM",
"+ => ALPHANUM",
". => ALPHANUM"
],
"split_on_numerics":"false"
}
},
"analyzer": {
"hash_analyzer": {
"type": "custom",
"tokenizer": "whitespace",
"filter": [
"lowercase",
"hash_filter"
],
"char_filter": "html_strip"
}
}
}

Below is the dummy mapper:
"mapping": {
"myIndex": {
"_all": {
"enabled": "true",
"index": "analyzed"
},
"properties": {
"description": {
"type": "string",
"index": "analyzed",
"analyzer": "hash_analyzer"
}
}
}
}

Please provide me tips on how to improve so that I can get better results.

Thank you :slight_smile:
Sri Harsha

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/e076367b-67ed-4c18-a68e-7ed0a8e54cbf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.