lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Smith" <ssm...@mainstreamdata.com>
Subject Deleting an index
Date Tue, 04 Jan 2005 00:39:54 GMT
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?

 

Scott

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message