You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by spinergywmy <sp...@gmail.com> on 2006/11/20 12:48:22 UTC

Delete contents from index

Hi,

   How can I delete the contents from Index file? Is there any example that
I can refer to?

   Thanks.


regards,
Wooi Meng
-- 
View this message in context: http://www.nabble.com/Delete-contents-from-index-tf2668566.html#a7441161
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Delete contents from index

Posted by Michael McCandless <lu...@mikemccandless.com>.
spinergywmy wrote:

>    How can I delete the contents from Index file? Is there any example that
> I can refer to?

Just create an IndexWriter with the 3rd boolean argument (create) set to 
true.  This will remove any existing files.

Alternatively, you can use FSDirectory.getDirectory(<path-to-index>, true).

Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org