0

I'm trying to remove accents of occurrences looked somewhat the same way that the function downcase.

Currently searching for all results starting with a string like that :

r.Table("places").Filter(func(customer r.Term) interface{}{
             return customer.Field("Name").Downcase().Match("^" + strings.ToLower(value))
         })

but it does not work with words with an accent in the word.

Example : with search word "yes", it'll find :

"yes"   "yesy"   "yessss"

but not

"yés"

What is the best way to remove accents in query to pick them up, too?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Fantasim
  • 876
  • 1
  • 12
  • 32
  • 1
    The term you want to search for is "Transliteration" – JimB Nov 03 '16 at 14:14
  • 6
    Possible duplicate of [Remove diacritics using Go](http://stackoverflow.com/questions/26722450/remove-diacritics-using-go) – jussius Nov 03 '16 at 14:14
  • The duplicate suggestion is correct, however this is usually handled by the database's own collation settings. If you can get rethink's index to do this for you regardless of the client side implementation, it's a better option. – Not_a_Golfer Nov 03 '16 at 14:48
  • @jussius How can use this function with rethinkdb ? – Fantasim Nov 03 '16 at 19:25

0 Answers0