lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bernhard Messer <Bernhard.Mes...@intrafind.de>
Subject Re: docfaq of IndexReader is showing the deleted document also
Date Tue, 27 Jul 2004 13:58:22 GMT
Hi Raju,

read the documentation for the IndexReader.delete method and you will 
find your way ;-)

/** Deletes the document numbered <code>docNum</code>.  Once a document is
   deleted it will not appear in TermDocs or TermPostitions enumerations.
   Attempts to read its field with the {@link #document}
   method will result in an error.  The presence of this document may 
still be
   reflected in the {@link #docFreq} statistic, though
   this will be corrected eventually as the index is further modified.
   */

public final synchronized void delete(int docNum) throws IOException


regards
Bernhard

lingaraju wrote:

>I used the below code
>
>IndexReader reader = IndexReader.open("c:/index");
>Term term = new Term("contents","books");
>int i=reader.docFreq(term);
>System.out.println("docfaq:"+i);
>reader.delete(term);
>i=reader.docFreq(term);
>System.out.println("docfaq:"+i);
>reader.close();
>
>reader.docFreq method is returning 10 count before delete even after delete
>also count is showing same why
>
>Regards
>Raju
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: lucene-dev-help@jakarta.apache.org
>
>
>  
>


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


Mime
View raw message