Hi! On Sun, Jan 06, 2008 at 07:16:48PM +0100, Lars Heese wrote: > Hello, > > does anybody know how to implement a "Did you mean ...?" like Google > with act_as_ferret? > > I think this is a possible way: > > 1. Generate a keyword-list (this is my difficulty. I don't know how to > build such a list from the index) with no stop-words from the first > index. > e. g. (car, ship, plant, house) > > 2. Build a second index from this word-list where we store the word in > the index. > > 3. Make a Fuzzy-Search over the new list, e. g. "pland" > > 4. Fetch the stored keyword => plant, now you can write "Did you mean > 'plant'?" > > 5. Make a sharp search with "plant" on the first index. > > How can I generate a word-list from the first (standard) index?
TermEnum (http://ferret.davebalmain.com/api/classes/Ferret/Index/TermEnum.html) might help here. You can't do this through acts_as_ferret, instead I'd suggest you create a little script outside your application which rebuilds the word-list index from the real index by using Ferret directly to access the index. cheers, Jens -- Jens Krämer http://www.jkraemer.net/ - Blog http://www.omdb.org/ - The new free film database _______________________________________________ Ferret-talk mailing list [email protected] http://rubyforge.org/mailman/listinfo/ferret-talk

