Hi, I am trying to do a search for a field that contains the word "in"
or "IN", but ferret doesn''t return me any result.
class User < ActiveRecord::Base
acts_as_ferret :fields => {
:user => {:store => :no },
:len => {:store => :yes}
}
end
ruby script/console
>> User.find_by_contents(''Cal'')
=> #<ActsAsFerret::SearchResults:0xb762ab58 @total_hits=1,
@results=[#<User:0xb762b8f0 @ferret_score=0.244397431612015,
@ferret_rank=1, @attributes={"user"=>"Cal Poly",
"id"=>"1",
"len"=>nil}>]>>> u = User.new
=> #<User:0xb76293fc @new_record=true,
@attributes={"user"=>nil,
"len"=>nil}>>> u.user = ''IN''
=> "IN">> u.save
=> true>> User.find_by_contents(''IN'')
=> #<ActsAsFerret::SearchResults:0xb76121ac @total_hits=0,
@results=[]>>> User.rebuild_index
=> {}>> User.find_by_contents(''IN'')
=> #<ActsAsFerret::SearchResults:0xb7605a38 @total_hits=0,
@results=[]>>> u.user = ''in''
=> "in">> u.save
=> true>> User.find_by_contents(''\i\n'')
=> #<ActsAsFerret::SearchResults:0xb75fd720 @total_hits=0,
@results=[]>>> User.find_by_contents(''in'')
=> #<ActsAsFerret::SearchResults:0xb75fbbc8 @total_hits=0, @results=[]>
so is "in" or "IN" a special word? What can I do to make
them appear in
my search result?
Is there a list of all the special words?
Thanks.
Yaxm
--
Posted via http://www.ruby-forum.com/.