I have a micro-mini-search engine that highlights the search terms in my rails app. The search ignores accents and the highlight is case insensitive. Almost perfect.
But, for instance if I have a record with the text “pão de queijo” and searches for “pao de queijo” the record is returned but the iext is not highlighted. Similarly, if I search for “pÃo de queijo” the record is returned but not highlighted properly.
My code is as simple as:
<%= highlight(result_pessoa.observacoes, search_string, '<span style="background-color: yellow;">\1</span>') %>
I’ve just submitted a patch to Rails thats solves this.
http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/3593-patch-support-for-highlighting-with-ignoring-special-chars