lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chhabra, Kapil" <>
Subject RE: deleting/updating/identifying a document
Date Fri, 20 Jul 2007 13:17:23 GMT
Is it not true for any RDBMS table as well which does not have a Primary
If this is a problem that you are facing, then it can be solved by
introducing one unique identifier as a field in your index which would
act as a Primary Key for your index.
Using an untokenized field might not be a good idea in some cases. :)

Also, the deleteDocuments(term[]) function then gives the added
flexibility of identifying and deleting more that one documents (by a
single function call) identified by an array of Primary Key values.


-----Original Message-----
From: Samuel LEMOINE [] 
Sent: Friday, July 20, 2007 6:31 PM
Subject: deleting/updating/identifying a document

Hi everybody !

I'm asking myself about the way Lucene deals with deleting documents.
As far as I know, a document is identified by a document number, but 
this document number is not reliable for long-term issues as it may 
change on segment merging.
The way Lucene deletes documents' data from the index questions me, 
cause it relies on terms (or document number, which as told above is not

reliable, and must be retrieved from a request). The methods I've found 
for deleting documents from the index are those from IndexWriter and 
IndexReader classes, deleteDocuments(term ) or deleteDocuments(term[] ).
These methods deletes the index'entries containing the given term. 
According to the API javadoc, deleteDocuments(term[] ) will delete each 
file that contains at least one of the given terms: if it really works 
in this way, I don't really understand why it's does so. Wouldn't it be 
more useful if it deleted each file containing *all of* the given terms?

(or maybe it'is the way it works actually?)
These reflexions lead me to conclude that, in order to be able to remove

the entries of a specific document in a Lucene index, we must store an 
untokenized field to identify each document solely. I find it strange 
having to use such an "artifice" to keep traces of documents 
independantly. It's not very impeding, it's just... strange.
Any contributive thinkings on this matter are welcome :)

Thanks for reading,


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message