Is "IN" a special word?

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

On May 29, 2007, at 06:33, Yaxm Y. wrote:

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.

looks like it is a stop word:

irb(main):003:0> Ferret::Analysis::FULL_ENGLISH_STOP_WORDS.include? ‘in’
=> true

stop words will not be indexed …

Ben

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs