On 8/22/06, Benjamin Krause <[EMAIL PROTECTED]> wrote:
>
> >> 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 ?
>
> hey ..
>
> i had the same problem.. using ferret, not acts_as_ferret.. the stopwords
> are described here:
> http://ferret.davebalmain.com/api/classes/Ferret/Analysis/StopAnalyzer.html
>
> what I do is to remove all stopwords from the query before searching..
>
> def self.filter_stop_words( q )
>   query = q.split(" ")
>   query.delete_if { |w| Indexer::STOP_WORDS.include?( w.downcase )
> }.join(" ")
> end
>
>
> Ben

Hi Ben,

This shouldn't be necessary. What Jens said is correct. If you use the
same analyzer in your indexer as you use in your query parser then a
search for "Ruby on Rails" should work. If you use the Index::Index
class this will be handled for you.

Cheers,
Dave
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to