lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From baronDodd <>
Subject Searches fail while indexwriter is open
Date Mon, 02 Apr 2007 11:38:26 GMT

I am currently writing a Lucene application and having a huge headache with

My requirements are that each time a file is indexed a search on its path is
performed to see if an update (delete then re-index) is required. If a
document with the same path exists then an IndexReader deletes the doc and
then a writer reindexes the fiel. Sadly due to requirements the deletes and
indexes can not be batch performed and I am constantly opening and closing
the IndexReader and IndexWriter between multiple threads. Everything has
been working fine and seems thread safe apart from this:

 If I index a test batch of 10 files and then once again a few minutes later
repeat the operation on the same files then all 10 are updated ok. However
when I perform the same test with more than about 10 files then my searches
fail to find about 25% of the already existing files and I end up with
duplicate entries in the index. I have managed to fix this by closing the
indexWriter every time an update search is performed but this has taken
performance to almost embarrasing levels! My understanding was that you
could search a Lucene index with an IndexSearcher while any write operations
are taking place? Is it possible that the search skips segments which are
currently being written to?
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