--- lucene-1.4.2/src/java/org/apache/lucene/index/IndexReader.java Wed Apr 21 09:46:30 2004
+++ lucene-1.4.2-patched/src/java/org/apache/lucene/index/IndexReader.java Wed Oct 13 11:45:42 2004
@@ -420,6 +420,13 @@
}
}
+ /** Deletes the document numbered docNum.
+ * @deprecated use deleteDocument(int docNum) instead.
+ */
+ public final synchronized void delete(int docNum) throws IOException {
+ deleteDocument(docNum);
+ }
+
/** Deletes the document numbered docNum. Once a document is
deleted it will not appear in TermDocs or TermPostitions enumerations.
Attempts to read its field with the {@link #document}
@@ -427,7 +434,7 @@
reflected in the {@link #docFreq} statistic, though
this will be corrected eventually as the index is further modified.
*/
- public final synchronized void delete(int docNum) throws IOException {
+ public final synchronized void deleteDocument(int docNum) throws IOException {
if(directoryOwner)
aquireWriteLock();
doDelete(docNum);
@@ -440,12 +447,19 @@
protected abstract void doDelete(int docNum) throws IOException;
/** Deletes all documents containing term.
+ * @deprecated use deleteDocuments(Term term) instead.
+ */
+ public final int delete(Term term) throws IOException {
+ return deleteDocuments(term);
+ }
+
+ /** Deletes all documents containing term.
This is useful if one uses a document field to hold a unique ID string for
the document. Then to delete such a document, one merely constructs a
term with the appropriate field and the unique ID string as its text and
passes it to this method. Returns the number of documents deleted.
*/
- public final int delete(Term term) throws IOException {
+ public final int deleteDocuments(Term term) throws IOException {
TermDocs docs = termDocs(term);
if (docs == null) return 0;
int n = 0;