lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otis Gospodnetic <otis_gospodne...@yahoo.com>
Subject Re: return value of terms()
Date Tue, 29 Jun 2004 11:46:41 GMT
I would try using the delete(Term) method, to ensure all documents with
the given Term are removed:

   IndexReader indexReader = IndexReader.open( indexPath ); 
   indexReader.delete( new Term( "body", "YourTermHere" ) );
   indexReader.close();
   ...
   IndexReader indexReader = IndexReader.open( indexPath );
   TermEnum enum = indexReader.terms( new Term( "body", "" ) );

Something like that...

Otis

--- Lars Martin <Lars.Martin@smb-tec.com> wrote:
> Hi.
> 
> Is it the normal behavior that IndexReader.terms( Term t ) still
> returns Terms which are not any longer to be found in the index,
> e.g. after removing the document containing these Terms?
> I've removed nearly all documents from index but the terms() method
> is still returning all terms.
> 
>   IndexReader indexReader = IndexReader.open( indexPath ); 
>   indexReader.delete( docId );
>   indexReader.close();
>   ...
>   IndexReader indexReader = IndexReader.open( indexPath );
>   TermEnum enum = indexReader.terms( new Term( "body", "" ) );
> 
> Any hints? Regards, Lars
>
______________________________________________________________________
> Lars Martin                            
> mailto:Lars.Martin@smb-tec.com
> SMB GmbH                                       
> http://www.smb-tec.com
> D-04347 Leipzig                                    Rohrteichstrasse
> 18
> Tel: +49-(0)341-699 46 04                    Fax: +49-(0)341-699 47
> 04
> Produkt-Manager Business Server BS1          Produkt-Manager
> CADDA.NET
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
> 
> 


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


Mime
View raw message