lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kelvin Tan <>
Subject Deleting fields from a Document
Date Thu, 31 Oct 2002 07:31:44 GMT
There is currently no way to delete fields from a Document. I 
wondered if this was evil, in any way, and looking at the source of, found no evidence that it is so. 

Document maintains a linked list of Fields. It would be not be 
difficult to delete a random Field, albeit a little inefficient.

The reason why I need to delete fields, is that my index has been 
inadvertently corrupted by fields with bad values from the 
application. Attempts to add in correct values for these fields don't 
solve the problem because the "bad" field still exists. One possible 
solution is to create a new document, enumerate through all the 
fields of the old document and add the ones you want. I don't have a 
huge problem with that, but I also wonder if field deletion is truly 

Maybe someone can shed some light here?


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

View raw message