Forum: Ferret fuzzy-ness to searches

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Chase S. (Guest)
on 2007-04-06 19:20
Hi. I didn't notice if topic has already been discussed, but I was
wondering if there was a way to make ferret match only part of a search
term. My initial thought was some sort of filter, but I'm unsure of
where to begin.

An example in the comments of the acts_as_ferret tutorial at RailsEnvy
( suggests:
To return the widest possible array you’d make everything OR’d and
@query = params[:search].split(” “).collect{|term| term + ”~”}.join(” 

However, the example appears only to work where there are multiple
search terms separated by a space like "Dark Star" => "Dark~ OR Star~".

Currently, in my basic rails app, ferret will only return results if the
search term exactly matches what is stored in the DB.


A search for "MCF" does not match "MCF-7", but a search for "MCF-7" will
exactly match the entries with the name "MCF-7" as expected.

Is there a way to get this partial matching behavior with ferret?


Chase S. (Guest)
on 2007-04-06 19:44
I have, however, noticed that this partial recognition works for longer
words like colo~ for colon, but not for smaller words as I mentioned

This topic is locked and can not be replied to.