Bloodhound Searches With International Characters in Statamic 1.9.x


As a work-around for Bloodhound not supporting utf-8 searches out-of-the-box we implemented a work-around where we would "slugify" our searches in client side Javascript before submitting the search form, e.g. changing the Swedish characters "åäö" for "aao". This appeared to match how Bloodhound performed the searches on the server side, so we were getting search results.

Something appears to have changed as of 1.9 (although I'm not 100% sure exactly when the change happened) however as we're no longer receiving the hits we expect when using this work-around. We still get results as expected when using queries containing only "normal" ASCII characters, but the "slugified" queries no longer appear to match anything.

We've tried removing the work-around as well, and still get no matches when using Swedish characters.

One thing I've noticed that may or may not be useful is in the saved query files under _cache/_add-ons/bloodhound/searches. The query parameter gets HTML-encoded ("spärr" becomes "spärr", for instance) but in the actual file contents the text is still utf-8 encoded ("spärr" is still "spärr") like on disk...

Might something have changed in Statamic that Bloodhound simply hasn't been updated for yet?

>>>>>>> Unanswered <<<<<<<
3 Replies
1 Follower