On Sat, Aug 26, 2006 at 04:12:57PM +0200, Florent Solt wrote:
> This script (http://pastie.caboo.se/10371) give this result :
> 
> "1"
> "0"
> "0"
> "0"
> 
> Why the other thread does not have the same result ?
> Maybe, it's not the correct way to use the index in a multi threaded 
> environement but I don't know how to do.

This should work, imho. I even tried to synchronize access to the index
like that:

guard = Mutex.new
[..]
and in the thread's block:
  guard.synchronize do
    result = index.search('id:42')
    p result.total_hits
  end

but the output stayed the same.

> Any ideas ?
You might try to use a Searcher instance for your searching in the
threads. Maybe the problem lies only in the Index class.

Your best bet however is to create separate Index instances in each 
thread.

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