Fuzzy searching using act_as_ferret

Hello,

My Ferret integration has gone quite well. I’m now returning all the
results I need from two models using “id_multi_search” and combining the
results in the view using a couple of partials.

Is there any way that I can turn on fuzzy searching?

Would fuzzy searching pick up basic spelling mistakes such as “Bnadit”
instead of “Bandit” my experience with search technology is quite
limited.

Cheers
Tom, Nottingham UK

Tom,

It depends on how you build your query.
Textually, the syntax is: +(body:word~0.5) if you want to search for
‘word’ in field ‘body’.

A more advanced way would to parse your query and then build manually
your ferret query. See
http://ferret.davebalmain.com/api/classes/Ferret/Search/FuzzyQuery.html
for more help.

Jean-Etienne

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs