[ 
https://issues.apache.org/jira/browse/LUCENE-1483?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12657330#action_12657330
 ] 

Michael McCandless commented on LUCENE-1483:
--------------------------------------------

{quote}
> the binary search gives back -insertionpoint - 1, the insertion point for 
> banana is 1, so -1 -1 = -2. So I reverse that and subtract 2 to get 0 right? 
> It lands on apple.
{quote}
Hmm -- I didn't realize binarySearch is returning the insertion point on a 
miss.  So your logic (negate then subtract 2) makes perfect sense now.

Just be sure... maybe you should temporarily add asserts when a negative index 
is returned that values[-index-2].compareTo(newValue) < 0 and values[-index-1] 
> 0 (making sure those array accesses are in bounds)?

{quote}
> (I dont remember off hand why subord has to start at 1 not 0, but i remember 
> it didnt work otherwise)
{quote}

This is very important -- that 1 is "equivalent" to the original 0.5 proposal, 
ie, think of subord as the 2nd digit in a 2-digit number.  That 2nd digit being 
non zero is how we know that even though banana's ord landed on apple's, banana 
is in fact *not* equal to apple (because the subord for banana is > 0) and is 
instead *between* apple and orange.

> Change IndexSearcher to use MultiSearcher semantics for multiple subreaders
> ---------------------------------------------------------------------------
>
>                 Key: LUCENE-1483
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1483
>             Project: Lucene - Java
>          Issue Type: Improvement
>    Affects Versions: 2.9
>            Reporter: Mark Miller
>            Priority: Minor
>         Attachments: LUCENE-1483.patch, LUCENE-1483.patch, LUCENE-1483.patch, 
> LUCENE-1483.patch, LUCENE-1483.patch, LUCENE-1483.patch, LUCENE-1483.patch, 
> LUCENE-1483.patch, LUCENE-1483.patch, LUCENE-1483.patch, LUCENE-1483.patch, 
> LUCENE-1483.patch, LUCENE-1483.patch, LUCENE-1483.patch
>
>
> FieldCache and Filters are forced down to a single segment reader, allowing 
> for individual segment reloading on reopen.

-- 
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: java-dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-dev-h...@lucene.apache.org

Reply via email to