I am trying to index text files and using the RAMDirectory for fast indexing and was wondering if there is a way to clear the previous RAMDirectory to prevent duplicates?
Asked
Active
Viewed 701 times
1 Answers
0
Not sure what you mean by "clear the previous RAMDirectory", but you can overwrite the previous index at the RAMDir by string the create flag to true. This would create a new index at the location for the constructor call.
IndexWriter(Directory d, Analyzer a, boolean create, IndexWriter.MaxFieldLength mfl)

Mikos
- 8,455
- 10
- 41
- 72
-
Thanks. I got it. I just forgot to close the IndexWriter. – P Topa May 25 '12 at 10:24