[ 
https://issues.apache.org/jira/browse/LUCENENET-103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12535663
 ] 

Digy commented on LUCENENET-103:
--------------------------------

Hi Jon,

I tested the code you sent with some "additions and deletions into the original 
index and checking the clones"  and it seems OK.
(Note: copying "sizeInBytes" field to clone is also needed).
(I prepared a patch for this but I am not sure  about sending this code, 
because I don't know if this action results in a Copyright violation or  not.)


My Test results are:
using orgDir.Clone(false)  -> 3t
using orgDir.Clone(true)   -> 7t
using new RAMDirectory(orgDir) -> 9.5t 
with ~150,000 docs containing ~1,200,000 terms (t:100ms).

But I have some hesitations on applying the patch to Lucene.Net

First, although I couldn't generate an error in "Clone(false)" case, I think it 
can be dangerous since it does not clone the byte array, instead just put the 
address into the buffer(and this is the reason of speed-up).

Second, the original java-code from Nick Smith(Adding clone method to 
RAMDirectory+RAMFile) is not included in the current release of the Java 
Lucene. Adding this functionality to Lucene.Net means divergence from the Java 
code.


So I leave that hot potato for George Aroush(the only commiter of this project).


DIGY




> Need to implement ICloneable on RAMDirectory
> --------------------------------------------
>
>                 Key: LUCENENET-103
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-103
>             Project: Lucene.Net
>          Issue Type: Improvement
>         Environment: C# 2.0
>            Reporter: Jon Davis
>            Priority: Minor
>
> IClonable needs to be added to Lucene.net's RAMDirectory.
> See Lucene (Java) item resolution at: 
> http://www.mail-archive.com/[EMAIL PROTECTED]/msg03725.html

-- 
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