lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kelvin Tan <lists-kel...@relevanz.com>
Subject Re: Best Practices for indexing in Web application
Date Tue, 02 Mar 2004 04:06:07 GMT


On Mon, 01 Mar 2004 12:24:26 +0100, Michael Steiger said:
> 1. Concurrency of IndexWriter and IndexReader
> It seems that it is not allowed to open an IndexWriter and an
> IndexReader at the same time. But if one user is changing records in the
> database (and therefore changing documents in the Lucene index) and
> another user is querying the index, I would need to open them both.

Not necessarily so. Shouldn't you be using an IndexSearcher to query the index 
instead of an IndexReader? IndexReader should be used primarily for deleting and 
low-level document retrieval via Terms.

> 
> 2. Optimizing the index
> This is maybe related to my first issue.
> I assume that while optimizing the index no queries are allowed. How
> often should the index be optimized?
>

Again, IndexSearcher has no problem with the index being modified (via 
optimizing, or otherwise) whilst searching. However, you'll need to have some 
way of refreshing your IndexSearcher when this happens, otherwise the 
IndexSearcher  would be obsolete.

Kelvin


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message