[ 
https://issues.apache.org/jira/browse/LUCENENET-257?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12779507#action_12779507
 ] 

Michael Garski commented on LUCENENET-257:
------------------------------------------

Good catch!  I had not noticed that setter.  I will update my patch to include 
it as well.

It seems weird that the method would take a double and cast it down into a 
long...  In Java any overflow will end up at the max value of a long, where in 
.NET it was coming up as the minimum value.  In order to mimic the Java 
behavior (debatable as to whether that is best) would be to test the value 
coming in and set maxMergeSize to Int64.MaxValue if it would otherwise overflow.

I don't think maxMergeSize should be a double, but rather the arguments to the 
get/set should be long or int.  The field is used in the mergePolicy to 
determine which segments to merge based on the sizeInBytes field of a 
SegmentInfo, which is a long.  The transformation into a double seems odd along 
with the name of the method "setMaxMergeMB(double MB)" when the mb parameter is 
the number bytes, that is multiplied by 1024^2 to set the value in MB

> TestCheckIndex.TestDeletedDocs 
> -------------------------------
>
>                 Key: LUCENENET-257
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-257
>             Project: Lucene.Net
>          Issue Type: Bug
>            Reporter: Andrei Iliev
>            Assignee: Digy
>         Attachments: LUCENENET-257.patch
>
>
> Setting writer.SetMaxBufferedDocs(2) couse flushing buffers after adding 
> every 2 docs. That  results in total 10 segments in the index and failing 
> TestDeletedDocs (test case assumes that there is only 1 segment file).  So 
> question arise:
> 1) does performing a flush has to start a new segment file?
> 2) if so, in order  to  run TestDeletedDocs smoothly either change  
> writer.SetMaxBufferedDocs(2) to, say,    writer.SetMaxBufferedDocs(20) or 
> call writer.optimize(1) before closing writer.

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

Reply via email to