Andy,

I think batching commits either by time or number of documents is common.

Do you know about NRT (Near Realtime Search)?: 
<http://wiki.apache.org/lucene-java/NearRealtimeSearch>.  Using 
IndexWriter.getReader(), you can avoid commits altogether, as well as reducing 
update->search latency.  See IndexWriter.getReader() javadocs for more details: 
<http://lucene.apache.org/java/3_0_2/api/all/org/apache/lucene/index/IndexWriter.html#getReader%28%29>.

Depending on requirements, these two strategies can be combined.

Steve

> -----Original Message-----
> From: andynuss [mailto:andrew_n...@yahoo.com]
> Sent: Monday, June 21, 2010 2:44 PM
> To: java-user@lucene.apache.org
> Subject: RE: search hits not returned until I stop and restart application
> 
> 
> "Maybe you aren't using the IndexReader instance returned by reopen(), but
> instead are continuing to use the instance on which you called reopen()?
> It's tough to figure this kind of thing out without looking at the code."
> 
> That was it, I was not using the newly (re)opened index.  By the way, one
> last question.  It doesn't matter for this because I'm indexing one huge
> document at a time, and then committing.  But later, I will also be
> indexing very small documents frequently.  In that case, it would seem
> that if I index a very small document, I don't want to be thrashing with a
> commit after each one, and then a reopen of the reader and reconstruction
> of my searcher.  Do others manage this type of thing with a thread that
> fires at intervals to commit if dirty?

Reply via email to