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 Alex Kiselevski <AL...@Amdocs.com> on 2004/12/08 15:34:14 UTC

Help to remove document

Hello,
Help me pls, I want to know how to remove document from index

Alex Kiselevsky
 Speech Technology		Tel:	972-9-776-43-46
R&D, Amdocs - Israel		Mobile:	972-53-63 50 38
mailto:alexkis@amdocs.com




The information contained in this message is proprietary of Amdocs,
protected from disclosure, and may be privileged.
The information is intended to be conveyed only to the designated recipient(s)
of the message. If the reader of this message is not the intended recipient,
you are hereby notified that any dissemination, use, distribution or copying of
this communication is strictly prohibited and may be unlawful.
If you have received this communication in error, please notify us immediately
by replying to the message and deleting it from your computer.
Thank you.

Re: Help to remove document

Posted by Luke Shannon <ls...@hypermedia.com>.
Hi;

The indexReader has a delete method that can do this:

public final void delete(int docNum)
throws IOException
Deletes the document numbered docNum. Once a document is deleted it will not
appear in TermDocs or TermPostitions enumerations. Attempts to read its
field with the document(int) method will result in an error. The presence of
this document may still be reflected in the
docFreq(org.apache.lucene.index.Term) statistic, though this will be
corrected eventually as the index is further modified.

There is an example of how it can be used in the Lucene demo. Ensure you
re-create the indexSearcher for the change to be reflected in your search
queries.

Luke
----- Original Message ----- 
From: "Alex Kiselevski" <AL...@Amdocs.com>
To: <lu...@jakarta.apache.org>
Sent: Wednesday, December 08, 2004 9:34 AM
Subject: Help to remove document



Hello,
Help me pls, I want to know how to remove document from index

Alex Kiselevsky
 Speech Technology Tel: 972-9-776-43-46
R&D, Amdocs - Israel Mobile: 972-53-63 50 38
mailto:alexkis@amdocs.com




The information contained in this message is proprietary of Amdocs,
protected from disclosure, and may be privileged.
The information is intended to be conveyed only to the designated
recipient(s)
of the message. If the reader of this message is not the intended recipient,
you are hereby notified that any dissemination, use, distribution or copying
of
this communication is strictly prohibited and may be unlawful.
If you have received this communication in error, please notify us
immediately
by replying to the message and deleting it from your computer.
Thank you.



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