lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From karl wettin <karl.wet...@gmail.com>
Subject Re: optimization behaviour
Date Fri, 11 May 2007 16:32:51 GMT

10 maj 2007 kl. 21.29 skrev Yonik Seeley:

> On 5/10/07, Yonik Seeley <yonik@apache.org> 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: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message