2

I've got a word in the text (e.g. nagymező) and I want to be able to type in the search query nagymező or nagymezo and it should show this text which contains that word in the search results.
How can it be accomplished?

We Are All Monica
  • 13,000
  • 8
  • 46
  • 72

2 Answers2

0

You want to use a Unicode folding strategy, probably the asciifolding filter. I'm not sure which version of Elasticsearch you're on, so here are a couple of documentation links:

We Are All Monica
  • 13,000
  • 8
  • 46
  • 72
-2

The trick is to remove the diacritics when you index them so they don't bother you anymore.

Have a look at ignore accents in elastic search with haystack and also at https://www.elastic.co/guide/en/elasticsearch/guide/current/custom-analyzers.html (look for 'diacritic' on the page).

Then, just because it will probably be useful to someone one day or the other, know that the regular expression \p{L} will match any Unicode letter :D

Hope this helps,

Romain Prévost
  • 513
  • 2
  • 12