lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Braun <>
Subject Re: Update index
Date Wed, 23 Aug 2006 08:13:59 GMT
Hi  Thomas,

> Is it possible to update fields in an existing index.
> If yes how to proceed.
I think you can only delete a document and then reindex the updated

    public static int  delTitle(String ID) {
    	try {
    		return writer.deleteDocuments(new Term("ID",ID));		
		} catch (IOException e) {
		return -1;
and then add the new document.

The prerequisite will be that you need a unique Identifier for that
Document to use for the deleteDocuments function (normally you won't
know the lucene's index document-id for the specific doc). The downside
of this is that the lucene-index document-id will change.


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

View raw message