I cooked up a little script to show what I mean. This doesn't look right 
to me, but maybe I just completely misunderstand QueryParser.
Same output on mswin32, unix, ferret 0.9 and 0.10
Cheers, Sam

require 'rubygems'
require 'ferret'
p Ferret::VERSION # 0.10.6

index = Ferret::Index::Index.new()

index << {:title => "Programming Ruby", :content => "yada yada yada"}
puts index.search("ruby").total_hits # returns 1

query_parser = Ferret::QueryParser.new( :default_field => :title )
query = query_parser.parse("title:ruby")
puts index.search(query).total_hits # returns 1

query_parser = Ferret::QueryParser.new( )
# :default_field:       Default: "*"
# The default field to search when no field is specified in the search 
string.
query = query_parser.parse("ruby")
puts index.search(query).total_hits # returns 0

-- 
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to