lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luke Shannon" <>
Subject Re: Deleting an index
Date Tue, 04 Jan 2005 14:44:56 GMT
If you opened an IndexReader was has it also been closed before you attempt
to delete?

----- Original Message ----- 
From: "Scott Smith" <>
To: <>
Sent: Monday, January 03, 2005 7:39 PM
Subject: Deleting an index

I'm writing some junit tests for my search code (which layers on top of
Lucene).  The tests all follow the same pattern:

1. setUp(): Create some directories; write some files to be indexed
2. someTest: Call the indexer to create an index on the generated
files; do several searches and verify counts, expected hits, etc.;
3. tearDown(): Delete all of the directories and associated files
included the just-created index.

My problem is that I am unable to delete the index.  I've narrowed it
down to something in the search routine not letting go of the index file
(i.e., if I do the indexing and comment out the search, then everything
deletes fine).  The search code is pretty straight forward.  It creates
a new IndexSearcher (which it caches and hence uses for all searches in
the test).  Each individual search simply creates several QueryParsers
and then combines them to do a search using the cached IndexSearcher.
After the last search, I close() the IndexSearcher.  But something still
seems to have hold of the index.  I've tried nulling the hits object,
but that didn't seem to affect anything.

Any ideas?


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

View raw message