We are using Elasticsearch in combination with App Search to power our site's search pages. We've encountered an issue where we noticed that we can't search for keywords such as "C#", "C++" and alike. Does anyone have any advice on how we can overcome this problem?
Asked
Active
Viewed 34 times
0
-
this answer https://stackoverflow.com/a/59934021/4039431 might help – Mar 19 '20 at 10:59
1 Answers
0
Hello its certainly that App search use by default the standard tokenizer that create only "C" token for "C#" and "C++"
POST _analyze
{
"text": "C++",
"tokenizer": "standard"
}
=>
{
"tokens" : [
{
"token" : "C",
"start_offset" : 0,
"end_offset" : 1,
"type" : "<ALPHANUM>",
"position" : 0
}
]
}
You can try to use the solution provided in this blog https://medium.com/@joecwu/elastic-app-search-360f0eba04bf ( the Hacking: Custom our own index settings parts, but be sure to read all the post since it explains the app search behavior ) to override the default app search mapping. But its a bit hacky for production.

Pierre Mallet
- 7,053
- 2
- 19
- 30