testing ferret in the console with configuring models
Ok this doesn’t prove much, but if you use ActsAsFerret you can play with Ferret in the console to your heart’s content.
rl@bloodandguts:~$ ./script/console
Loading development environment (Rails 2.2.2)
>> module Ferret::Analysis
>> class StemmingAnalyzer
>> def token_stream(field, text)
>> StemFilter.new(StandardTokenizer.new(text))
>> end
>> end
>> end
=> nil
>> index = Ferret::I.new(:analyser => Ferret::Analysis::StemmingAnalyzer.new)
=> #<Ferret::Index::Index:0x7fc2683559f8 @open=true, @mon_owner=nil, @id_field=:id, @writer=nil, @searcher=nil, @mon_waiting_queue=[], @dir=#<Ferret::Store::RAMDirectory:0x7fc2683559a8>, @default_input_field=:id, @key=nil, @auto_flush=false, @mon_entering_queue=[], @qp=nil, @close_dir=true, @mon_count=0, @default_field=:*, @reader=nil, @options={:dir=>#<Ferret::Store::RAMDirectory:0x7fc2683559a8>, :analyzer=>#<Ferret::Analysis::StandardAnalyzer:0x7fc2683557f0>, :lock_retry_time=>2, :analyser=>#<Ferret::Analysis::StemmingAnalyzer:0x7fc268355a20>, :default_field=>:*}>
>> index << 'fly'
=> nil
>> index.search('fly').total_hits
=> 1
>> index.search('flies').total_hits
=> 0