Hi David,

Thanks for the heads up re: index readers & writers.

Just one more question:  how do you search an Index in read-only mode?

The :autoflush option sounds like a viable backup scenario as well, but 
I couldn't find anything in the docs about it.  (tried passing it into 
index via something like: Index::Index.new(:autoflush => true) but it 
dodn't like that either)

Cheers,

- Shanti

David Balmain wrote:
> Hi Shanti,
> 
> When you have multi processes accessing the index, it's not a matter
> of which class you use but how many processes you have writing to the
> index. The recommended way to do things is to have only one process
> writing to the index. You can have as many index readers open as you
> like. The trouble is that the IndexWriter opens a commit lock on the
> index. If another IndexWriter comes along and tries to open the lock
> at the same time it will raise an exception. The same thing goes for
> using the Index class as it is just really a simple interface to the
> IndexWriter and IndexReader classes.
> 
> One possibility is to use the Index class with :autoflush set to true.
> This should work most of the time as the IndexWriter class will keep
> trying for 5 seconds (broken in C version of 0.9.0, 0.9.1) to gain the
> commit lock so if it misses the first time it should eventually get
> it. This is an easy way to do things but it's still dangerous. I'd
> recommend using a single IndexWriter as described above. That doesn't
> mean you have to use the IndexWriter and IndexReader classes. You can
> still use the Index class as long as only one Index is doing the
> writing.
> 
> I hope that helps. Stay tuned for much better documentation on this.
> 
> Dave


-- 
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to