On 4/6/07, Harman Sandjaja <[EMAIL PROTECTED]> wrote:
> Hi guys,
>
> I am using acts_as_ferret to do full text search on my models and I am
> having problem on three-letter word searches.
>
> I am going to use an example to explain my problem. Here it is:
>
> There is a table called users and it has login, first_name, last_name
> columns. There are three rows inside it.
>
> login        first_name     last_name
> bob          bob            henry
> longbob      nil            nil
> existingbob  nil            nil
>
> Now I am expecting to get all three rows as the search result and my
> search query is: "bob OR *bob* OR bob* OR *bob"
> However, I am only getting longbob and existingbob rows, not the user
> bob.
>
> I have tried many other queries and still no luck. At first I thought
> that some columns might not be indexed properly but doing login:bob
> returns me with the user bob, so I don't think that it's indexing
> problem anymore.
>
> Any idea?

Sorry, I can't seem to replicate this problem;

  require 'ferret'
  i = Ferret::Index::Index.new()
  i << {:login => "bob",         :first_name => "bob", :last_name => "henry"}
  i << {:login => "longbob",     :first_name => nil, :last_name => nil}
  i << {:login => "existingbob", :first_name => nil, :last_name => nil}
  puts i.search("bob OR *bob* OR bob* OR *bob").to_s(:login)

Gives me the correct output;

  TopDocs: total_hits = 3, max_score = 2.091924 [
          0 "bob": 2.091924
          1 "longbob": 0.045950
          2 "existingbob": 0.045950
  ]

Perhaps you are using an earlier version of Ferret. Otherwise I'm not
sure what the problem might me.

-- 
Dave Balmain
http://www.davebalmain.com/
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to