lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From melix <>
Subject Realtime search best practices
Date Mon, 12 Oct 2009 09:24:59 GMT


I'm going to replace an old reader/writer synchronization mechanism we had
implemented with the new near realtime search facilities in Lucene 2.9.
However, it's still a bit unclear on how to efficiently do it.

Is the following implementation the good way to do achieve it ? The context
is concurrent read/writes on an index :

1. create a Directory instance
2. create a writer on this directory
3. on each write request, add document to the writer
4. on each read request, 
 a. use writer.getReader() to obtain an up-to-date reader
 b. create an IndexSearcher with that reader
 c. perform Query
 d. close IndexSearcher
5. on application close
 a. close writer
 b. close directory

While this seems to be ok, I'm really wondering about the performance of
opening a searcher for each request. I could introduce some kind of delay
and cache a searcher for some seconds, but I'm not sure it's the best thing
to do.



View this message in context:
Sent from the Lucene - Java Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message