lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Willnauer (JIRA)" <>
Subject [jira] Updated: (LUCENE-2802) DirectoryReader ignores NRT SegmentInfos in #isOptimized()
Date Mon, 06 Dec 2010 23:50:09 GMT


Simon Willnauer updated LUCENE-2802:

    Attachment: LUCENE-2802.patch

here is a patch that removes the mutable state from DirectoryReader in the NRT case. The actual
reason IMO why this has been introduced was that the RT reader returns true from #isCurrent()
if the wirter was closed which is actually wrong since closing a writer changes the index
and the reader should see that change.

I also added a testcase for is current to check the semantics

> DirectoryReader ignores NRT SegmentInfos in #isOptimized()
> ----------------------------------------------------------
>                 Key: LUCENE-2802
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>    Affects Versions: 4.0
>            Reporter: Simon Willnauer
>            Assignee: Simon Willnauer
>         Attachments: LUCENE-2802.patch, LUCENE-2802.patch
> DirectoryReader  only takes shared (with IW) SegmentInfos into account in DirectoryReader#isOptimized().
This can return true even if the actual realtime reader sees more than one segments. 
> {code}
> public boolean isOptimized() {
>     ensureOpen();
>    // if segmentsInfos changes in IW this can return false positive
>     return segmentInfos.size() == 1 && !hasDeletions();
>   }
> {code}
> DirectoryReader should check if this reader has a non-nul segmentInfosStart and use that

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

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

View raw message