On Sun, Aug 20, 2006 at 06:53:30AM +0200, Rami wrote:
> I am unable to find results for models when one or more of the terms are 
> not being indexed.
> 
> Lets suppose I index a User on the phrase "Ruby on Rails."  If I then 
> search using User.find_by_contents("Ruby on Rails") I get no results, 
> since "or" is a common term and does not get indexed.  Of course, 
> User.find_by_contents("Ruby Rails") works just fine.

this shouldn't happen. Do you build your index through acts_as_ferret ?

The cause of your problem seems to be that there's a different anylyzer
in use for query parsing than the one that was used for building the
index. usually queries should get analyzed the same way as contents to
avoid those problems.

> I would like to find a way to search for terms such as "Ruby on Rails" 
> and have the query analyzer automatically ignore tokens (ie, "or") that 
> the indexer would normally avoid. Any thoughts on how to go about 
> solving this?

try to specify an analyzer in your call to acts_as_ferret:

acts_as_ferret( { :fields => [ .. field list, may be a hash, too ] }, 
                { :analyzer => Ferret::Analysis::StopAnalyzer.new } )

Please let me know if this helps.

Jens


-- 
webit! Gesellschaft für neue Medien mbH          www.webit.de
Dipl.-Wirtschaftsingenieur Jens Krämer       [EMAIL PROTECTED]
Schnorrstraße 76                         Tel +49 351 46766  0
D-01069 Dresden                          Fax +49 351 46766 66
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to