Index: Document.java =================================================================== RCS file: /home/cvspublic/jakarta-lucene/src/java/org/apache/lucene/document/Document.java,v retrieving revision 1.16 diff -u -r1.16 Document.java --- Document.java 29 Mar 2004 22:48:01 -0000 1.16 +++ Document.java 18 Apr 2004 16:22:36 -0000 @@ -17,6 +17,7 @@ */ import java.util.Enumeration; +import java.util.Iterator; import java.util.List; import java.util.ArrayList; import java.util.Vector; @@ -79,6 +80,17 @@ * treated as though appended for the purposes of search. */ public final void add(Field field) { fields.add(field); + } + + /** Removes all fields with the given name from the document. */ + public final void remove(String name) { + Iterator it = fields.iterator(); + while (it.hasNext()) { + Field field = (Field)it.next(); + if (field.name().equals(name)) { + it.remove(); + } + } } /** Returns a field with the given name if any exist in this document, or