Searching special characters with solr and sunspot-rails
-
09-12-2019 - |
Question
I have sunspot-rails setup on a Rails 3.1 app. I was wondering if there's a way to map normal characters to special characters automatically when sunspot searches the solr index?
For example: if a user searches "cafe", they will also see results for "café".
Any help would be appreciated.
Solution
You could accomplish that by adding the AsciiFoldingFilter to your field for indexing/query
http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#solr.ASCIIFoldingFilterFactory
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow