RAMDirectory Lucene

717 Views Asked by At

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?

1

There are 1 best solutions below

1
Mikos On

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) 

Constructs an IndexWriter for the index in d.