10 maj 2007 kl. 21.29 skrev Yonik Seeley:

On 5/10/07, Yonik Seeley <[EMAIL PROTECTED]> wrote:
Deleted documents are removed on segment merges (for documents marked
as deleted in those segments).

Of course, that doesn't have to be the case.  It would be a trivial
change to merge segments and not remove the deleted docs.  That
usecase could be useful in conjunction with ParallelReader.

I'm at this now. There are two issues as far as I got:

The IllegalArgumentException thrown in SegmentReader.document

  /**
   * @throws CorruptIndexException if the index is corrupt
   * @throws IOException if there is a low-level IO error
   */
public synchronized Document document(int n, FieldSelector fieldSelector) throws CorruptIndexException, IOException {
      ensureOpen();
    if (isDeleted(n))
      throw new IllegalArgumentException
              ("attempt to access a deleted document");
    return fieldsReader.doc(n, fieldSelector);
  }

I can get around that problem, but I still have to ask: is there a reason for not allowing consumers to read deleted documents?

I'm not certain how to mark the document deleted in the merged directory via SegmentMerger.mergeField or FieldsWriter.addDocument. Without doing that, the document will not be deleted. My solution for now is to add an empty dummy document instead.





--
karl



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to