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 "Thutika, Swamy" <Sw...@gs.com> on 2002/01/09 15:40:36 UTC

Problem in deleteing the documents

Hi,
  I am not able to delete the documents from the index. Could someone please
exaplain me as to what am i doing
  working. I attached the delete and indexing code below:

   <<IdxReader.java>>  <<DeleteFile.java>> 

  Before deleting the output of IdxReader is :
N umber of docs :1
Term<body:are>
Term<body:deleted>
Term<body:getting>
Term<body:not>
Term<body:why>
Term<body:you>
Term<path:docone>

After delete:
umber of docs :0
Term<body:are>
Term<body:deleted>
Term<body:getting>
Term<body:not>
Term<body:why>
Term<body:you>
Term<path:docone>

  Thanks in advance

Swamy

   

Re: Problem in deleteing the documents

Posted by Ian Lea <ia...@blackwell.co.uk>.
If you read the javadoc for IndexReader.delete() you will
see that deleted documents don't disappear immediately,
unless you call optimize(), but will disappear as the index
gets modified further.

IndexReader.isDeleted(i) says whether a particular document
has been deleted.


--
Ian Lea
ian.lea@blackwell.co.uk



"Thutika, Swamy" wrote:
> 
> Hi,
>   I am not able to delete the documents from the index. Could someone please
> exaplain me as to what am i doing
>   working. I attached the delete and indexing code below:
> 
>    <<IdxReader.java>>  <<DeleteFile.java>>
> 
>   Before deleting the output of IdxReader is :
> N umber of docs :1
> Term<body:are>
> Term<body:deleted>
> Term<body:getting>
> Term<body:not>
> Term<body:why>
> Term<body:you>
> Term<path:docone>
> 
> After delete:
> umber of docs :0
> Term<body:are>
> Term<body:deleted>
> Term<body:getting>
> Term<body:not>
> Term<body:why>
> Term<body:you>
> Term<path:docone>
> 
>   Thanks in advance
> 
> Swamy

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>