You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by "Andrei Iliev (JIRA)" <ji...@apache.org> on 2009/11/18 23:04:39 UTC
[jira] Created: (LUCENENET-287)
TestIndexWriterReader.TestUpdateDocument
TestIndexWriterReader.TestUpdateDocument
------------------------------------------
Key: LUCENENET-287
URL: https://issues.apache.org/jira/browse/LUCENENET-287
Project: Lucene.Net
Issue Type: Bug
Reporter: Andrei Iliev
Attachments: SegmentInfos.patch
SegmentInfos is derived from ArrayList. So Equals and GetHashCode should behave as java ArrayList (see LUCENENET-284).
After that patch TestIndexWriterReader.TestUpdateDocument
Add Equal and GetHashCode to SegmentInfos
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (LUCENENET-287)
TestIndexWriterReader.TestUpdateDocument
Posted by "Digy (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENENET-287?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Digy updated LUCENENET-287:
---------------------------
Attachment: SegmentInfos-DIGY.patch
Thanks Andrei, I replaced the patch.
> TestIndexWriterReader.TestUpdateDocument
> ------------------------------------------
>
> Key: LUCENENET-287
> URL: https://issues.apache.org/jira/browse/LUCENENET-287
> Project: Lucene.Net
> Issue Type: Bug
> Reporter: Andrei Iliev
> Attachments: SegmentInfos-DIGY.patch, SegmentInfos-DIGY.patch, SegmentInfos.patch, SegmentInfos2.patch, SegmentInfos3.patch, SegmentInfos4.patch
>
>
> SegmentInfos is derived from ArrayList. So Equals and GetHashCode should behave as java ArrayList (see LUCENENET-284).
> After that patch TestIndexWriterReader.TestUpdateDocument is passed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (LUCENENET-287)
TestIndexWriterReader.TestUpdateDocument
Posted by "Michael Garski (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENENET-287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12782977#action_12782977 ]
Michael Garski commented on LUCENENET-287:
------------------------------------------
Your patch looks good to me DIGY, just tried it out and it fixes the tests and I don't see any negative impact.
> TestIndexWriterReader.TestUpdateDocument
> ------------------------------------------
>
> Key: LUCENENET-287
> URL: https://issues.apache.org/jira/browse/LUCENENET-287
> Project: Lucene.Net
> Issue Type: Bug
> Reporter: Andrei Iliev
> Attachments: SegmentInfos-DIGY.patch, SegmentInfos.patch, SegmentInfos2.patch, SegmentInfos3.patch, SegmentInfos4.patch
>
>
> SegmentInfos is derived from ArrayList. So Equals and GetHashCode should behave as java ArrayList (see LUCENENET-284).
> After that patch TestIndexWriterReader.TestUpdateDocument is passed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (LUCENENET-287)
TestIndexWriterReader.TestUpdateDocument
Posted by "Andrei Iliev (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENENET-287?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrei Iliev updated LUCENENET-287:
-----------------------------------
Attachment: SegmentInfos2.patch
New patch based on LUCENENET-292
> TestIndexWriterReader.TestUpdateDocument
> ------------------------------------------
>
> Key: LUCENENET-287
> URL: https://issues.apache.org/jira/browse/LUCENENET-287
> Project: Lucene.Net
> Issue Type: Bug
> Reporter: Andrei Iliev
> Attachments: SegmentInfos.patch, SegmentInfos2.patch
>
>
> SegmentInfos is derived from ArrayList. So Equals and GetHashCode should behave as java ArrayList (see LUCENENET-284).
> After that patch TestIndexWriterReader.TestUpdateDocument is passed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (LUCENENET-287)
TestIndexWriterReader.TestUpdateDocument
Posted by "George Aroush (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENENET-287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12780247#action_12780247 ]
George Aroush commented on LUCENENET-287:
-----------------------------------------
This patch has a dependency on LUCENENET-284 which I have not yet reviewed, so I'm not yet ready to accept it just yet.
> TestIndexWriterReader.TestUpdateDocument
> ------------------------------------------
>
> Key: LUCENENET-287
> URL: https://issues.apache.org/jira/browse/LUCENENET-287
> Project: Lucene.Net
> Issue Type: Bug
> Reporter: Andrei Iliev
> Attachments: SegmentInfos.patch
>
>
> SegmentInfos is derived from ArrayList. So Equals and GetHashCode should behave as java ArrayList (see LUCENENET-284).
> After that patch TestIndexWriterReader.TestUpdateDocument is passed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (LUCENENET-287)
TestIndexWriterReader.TestUpdateDocument
Posted by "Andrei Iliev (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENENET-287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12781955#action_12781955 ]
Andrei Iliev commented on LUCENENET-287:
----------------------------------------
Upd.
Actually
ArrayList.GetRange Method - Returns an ArrayList which represents a subset of the elements in the source
List.GetRange Method - Creates a shallow copy of a range of elements in the source List.
That is why we had no problems when SegmentInfos was derived from ArrayList, but got a proble when derive from SupportClass.EquatableList
> TestIndexWriterReader.TestUpdateDocument
> ------------------------------------------
>
> Key: LUCENENET-287
> URL: https://issues.apache.org/jira/browse/LUCENENET-287
> Project: Lucene.Net
> Issue Type: Bug
> Reporter: Andrei Iliev
> Attachments: SegmentInfos.patch, SegmentInfos2.patch
>
>
> SegmentInfos is derived from ArrayList. So Equals and GetHashCode should behave as java ArrayList (see LUCENENET-284).
> After that patch TestIndexWriterReader.TestUpdateDocument is passed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (LUCENENET-287)
TestIndexWriterReader.TestUpdateDocument
Posted by "Andrei Iliev (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENENET-287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12781934#action_12781934 ]
Andrei Iliev commented on LUCENENET-287:
----------------------------------------
Latest patch (SegmentInfos.patch) resolve at least 2 test cases:
TestIndexWriterReader.TestUpdateDocument
TestIndexWriterReader.TestAddIndexes
List of fixes:
1) EquatableList's Clone method should be virtual as it has to be overriden in SegmentInfos (patch for SupportClass)
2) there is a code in IndexWriter:
((System.Collections.IList) ((System.Collections.ArrayList) segmentInfos).GetRange(start, start + merge.segments.Count - start)).Clear();
in java it was
segmentInfos.subList(start, start + merge.segments.size()).clear();
In java subList returns view ob the List, but in .Net it is a shallow copy of the list. This code has been change to:
segmentInfos.RemoveRange(start, start + merge.segments.Count - start);
> TestIndexWriterReader.TestUpdateDocument
> ------------------------------------------
>
> Key: LUCENENET-287
> URL: https://issues.apache.org/jira/browse/LUCENENET-287
> Project: Lucene.Net
> Issue Type: Bug
> Reporter: Andrei Iliev
> Attachments: SegmentInfos.patch, SegmentInfos2.patch
>
>
> SegmentInfos is derived from ArrayList. So Equals and GetHashCode should behave as java ArrayList (see LUCENENET-284).
> After that patch TestIndexWriterReader.TestUpdateDocument is passed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (LUCENENET-287)
TestIndexWriterReader.TestUpdateDocument
Posted by "Andrei Iliev (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENENET-287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12782981#action_12782981 ]
Andrei Iliev commented on LUCENENET-287:
----------------------------------------
Digy, don't change "h" in GetHashCode to base.GetHashCode() - this is a bug. If you do it, you'll get different hash code for array that are Equals.
Example:
static void Main(string[] args)
{
ArraListDest list1 = new ArraListDest();
ArraListDest list2 = new ArraListDest();
for (int i = 1; i < 10; i++)
{
list1.Add(i);
list2.Add(i);
}
Console.WriteLine("list1.Equals(list2)=" + list1.Equals(list2));
Console.WriteLine("list1.GetHashCode()=" + list1.GetHashCode());
Console.WriteLine("list2.GetHashCode()=" + list2.GetHashCode());
}
class ArraListDest : System.Collections.ArrayList
{
public override int GetHashCode()
{
int h = base.GetHashCode();
for (int i = 0; i < this.Count; i++)
{
Object si = this[i] ;
h = 31 * h + (si == null ? 0 : si.GetHashCode());
}
return h;
}
public override bool Equals(object obj)
{
if (obj == null) return false;
ArraListDest objToCompare = obj as ArraListDest;
if (objToCompare == null) return false;
if (this.Count != objToCompare.Count) return false;
for (int idx = 0; idx < this.Count; idx++)
{
if (!this[idx].Equals(objToCompare[idx])) return false;
}
return true;
}
}
> TestIndexWriterReader.TestUpdateDocument
> ------------------------------------------
>
> Key: LUCENENET-287
> URL: https://issues.apache.org/jira/browse/LUCENENET-287
> Project: Lucene.Net
> Issue Type: Bug
> Reporter: Andrei Iliev
> Attachments: SegmentInfos-DIGY.patch, SegmentInfos.patch, SegmentInfos2.patch, SegmentInfos3.patch, SegmentInfos4.patch
>
>
> SegmentInfos is derived from ArrayList. So Equals and GetHashCode should behave as java ArrayList (see LUCENENET-284).
> After that patch TestIndexWriterReader.TestUpdateDocument is passed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (LUCENENET-287)
TestIndexWriterReader.TestUpdateDocument
Posted by "George Aroush (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENENET-287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12780385#action_12780385 ]
George Aroush commented on LUCENENET-287:
-----------------------------------------
This patch is no longer valid because in LUCENENET-284, I used Nick's patch.
> TestIndexWriterReader.TestUpdateDocument
> ------------------------------------------
>
> Key: LUCENENET-287
> URL: https://issues.apache.org/jira/browse/LUCENENET-287
> Project: Lucene.Net
> Issue Type: Bug
> Reporter: Andrei Iliev
> Attachments: SegmentInfos.patch
>
>
> SegmentInfos is derived from ArrayList. So Equals and GetHashCode should behave as java ArrayList (see LUCENENET-284).
> After that patch TestIndexWriterReader.TestUpdateDocument is passed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (LUCENENET-287)
TestIndexWriterReader.TestUpdateDocument
Posted by "Andrei Iliev (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENENET-287?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrei Iliev updated LUCENENET-287:
-----------------------------------
Attachment: SegmentInfos.patch
This path also resolve TestIndexWriterReader.TestAddIndexes
> TestIndexWriterReader.TestUpdateDocument
> ------------------------------------------
>
> Key: LUCENENET-287
> URL: https://issues.apache.org/jira/browse/LUCENENET-287
> Project: Lucene.Net
> Issue Type: Bug
> Reporter: Andrei Iliev
> Attachments: SegmentInfos.patch, SegmentInfos2.patch
>
>
> SegmentInfos is derived from ArrayList. So Equals and GetHashCode should behave as java ArrayList (see LUCENENET-284).
> After that patch TestIndexWriterReader.TestUpdateDocument is passed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (LUCENENET-287)
TestIndexWriterReader.TestUpdateDocument
Posted by "Digy (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENENET-287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12782597#action_12782597 ]
Digy commented on LUCENENET-287:
--------------------------------
I liked that SegmentInfos3.patch
DIGY
> TestIndexWriterReader.TestUpdateDocument
> ------------------------------------------
>
> Key: LUCENENET-287
> URL: https://issues.apache.org/jira/browse/LUCENENET-287
> Project: Lucene.Net
> Issue Type: Bug
> Reporter: Andrei Iliev
> Attachments: SegmentInfos.patch, SegmentInfos2.patch, SegmentInfos3.patch
>
>
> SegmentInfos is derived from ArrayList. So Equals and GetHashCode should behave as java ArrayList (see LUCENENET-284).
> After that patch TestIndexWriterReader.TestUpdateDocument is passed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (LUCENENET-287)
TestIndexWriterReader.TestUpdateDocument
Posted by "Andrei Iliev (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENENET-287?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrei Iliev updated LUCENENET-287:
-----------------------------------
Attachment: SegmentInfos.patch
> TestIndexWriterReader.TestUpdateDocument
> ------------------------------------------
>
> Key: LUCENENET-287
> URL: https://issues.apache.org/jira/browse/LUCENENET-287
> Project: Lucene.Net
> Issue Type: Bug
> Reporter: Andrei Iliev
> Attachments: SegmentInfos.patch
>
>
> SegmentInfos is derived from ArrayList. So Equals and GetHashCode should behave as java ArrayList (see LUCENENET-284).
> After that patch TestIndexWriterReader.TestUpdateDocument
> Add Equal and GetHashCode to SegmentInfos
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (LUCENENET-287)
TestIndexWriterReader.TestUpdateDocument
Posted by "Digy (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENENET-287?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Digy updated LUCENENET-287:
---------------------------
Attachment: SegmentInfos-DIGY.patch
I moved the code to the end of the class and changed the initial value of "h" in GetHashCode to base.GetHashCode().
If no objections, I will commit this patch.
DIGY
> TestIndexWriterReader.TestUpdateDocument
> ------------------------------------------
>
> Key: LUCENENET-287
> URL: https://issues.apache.org/jira/browse/LUCENENET-287
> Project: Lucene.Net
> Issue Type: Bug
> Reporter: Andrei Iliev
> Attachments: SegmentInfos-DIGY.patch, SegmentInfos.patch, SegmentInfos2.patch, SegmentInfos3.patch, SegmentInfos4.patch
>
>
> SegmentInfos is derived from ArrayList. So Equals and GetHashCode should behave as java ArrayList (see LUCENENET-284).
> After that patch TestIndexWriterReader.TestUpdateDocument is passed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (LUCENENET-287)
TestIndexWriterReader.TestUpdateDocument
Posted by "Eran Sevi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENENET-287?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eran Sevi updated LUCENENET-287:
--------------------------------
Attachment: SegmentInfos4.patch
Added new patch with both fixes suggested above (casting and hash code).
Eran.
> TestIndexWriterReader.TestUpdateDocument
> ------------------------------------------
>
> Key: LUCENENET-287
> URL: https://issues.apache.org/jira/browse/LUCENENET-287
> Project: Lucene.Net
> Issue Type: Bug
> Reporter: Andrei Iliev
> Attachments: SegmentInfos.patch, SegmentInfos2.patch, SegmentInfos3.patch, SegmentInfos4.patch
>
>
> SegmentInfos is derived from ArrayList. So Equals and GetHashCode should behave as java ArrayList (see LUCENENET-284).
> After that patch TestIndexWriterReader.TestUpdateDocument is passed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (LUCENENET-287)
TestIndexWriterReader.TestUpdateDocument
Posted by "Digy (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENENET-287?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Digy resolved LUCENENET-287.
----------------------------
Resolution: Fixed
final patch applied.
DIGY
> TestIndexWriterReader.TestUpdateDocument
> ------------------------------------------
>
> Key: LUCENENET-287
> URL: https://issues.apache.org/jira/browse/LUCENENET-287
> Project: Lucene.Net
> Issue Type: Bug
> Reporter: Andrei Iliev
> Attachments: SegmentInfos-DIGY.patch, SegmentInfos-DIGY.patch, SegmentInfos.patch, SegmentInfos2.patch, SegmentInfos3.patch, SegmentInfos4.patch
>
>
> SegmentInfos is derived from ArrayList. So Equals and GetHashCode should behave as java ArrayList (see LUCENENET-284).
> After that patch TestIndexWriterReader.TestUpdateDocument is passed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (LUCENENET-287)
TestIndexWriterReader.TestUpdateDocument
Posted by "Andrei Iliev (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENENET-287?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrei Iliev updated LUCENENET-287:
-----------------------------------
Attachment: (was: SegmentInfos.patch)
> TestIndexWriterReader.TestUpdateDocument
> ------------------------------------------
>
> Key: LUCENENET-287
> URL: https://issues.apache.org/jira/browse/LUCENENET-287
> Project: Lucene.Net
> Issue Type: Bug
> Reporter: Andrei Iliev
> Attachments: SegmentInfos2.patch
>
>
> SegmentInfos is derived from ArrayList. So Equals and GetHashCode should behave as java ArrayList (see LUCENENET-284).
> After that patch TestIndexWriterReader.TestUpdateDocument is passed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (LUCENENET-287)
TestIndexWriterReader.TestUpdateDocument
Posted by "Andrei Iliev (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENENET-287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12780962#action_12780962 ]
Andrei Iliev commented on LUCENENET-287:
----------------------------------------
Something wrong with making SegmentInfos as descendant of SupportClass.EquatableList<SegmentInfo>. Many test fails. I'll try to find what is wrong. Until it becomes clear what the problem, do not use this patch.
> TestIndexWriterReader.TestUpdateDocument
> ------------------------------------------
>
> Key: LUCENENET-287
> URL: https://issues.apache.org/jira/browse/LUCENENET-287
> Project: Lucene.Net
> Issue Type: Bug
> Reporter: Andrei Iliev
> Attachments: SegmentInfos2.patch
>
>
> SegmentInfos is derived from ArrayList. So Equals and GetHashCode should behave as java ArrayList (see LUCENENET-284).
> After that patch TestIndexWriterReader.TestUpdateDocument is passed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (LUCENENET-287)
TestIndexWriterReader.TestUpdateDocument
Posted by "Andrei Iliev (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENENET-287?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrei Iliev updated LUCENENET-287:
-----------------------------------
Description:
SegmentInfos is derived from ArrayList. So Equals and GetHashCode should behave as java ArrayList (see LUCENENET-284).
After that patch TestIndexWriterReader.TestUpdateDocument is passed.
was:
SegmentInfos is derived from ArrayList. So Equals and GetHashCode should behave as java ArrayList (see LUCENENET-284).
After that patch TestIndexWriterReader.TestUpdateDocument
Add Equal and GetHashCode to SegmentInfos
> TestIndexWriterReader.TestUpdateDocument
> ------------------------------------------
>
> Key: LUCENENET-287
> URL: https://issues.apache.org/jira/browse/LUCENENET-287
> Project: Lucene.Net
> Issue Type: Bug
> Reporter: Andrei Iliev
> Attachments: SegmentInfos.patch
>
>
> SegmentInfos is derived from ArrayList. So Equals and GetHashCode should behave as java ArrayList (see LUCENENET-284).
> After that patch TestIndexWriterReader.TestUpdateDocument is passed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (LUCENENET-287)
TestIndexWriterReader.TestUpdateDocument
Posted by "Digy (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENENET-287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12782597#action_12782597 ]
Digy edited comment on LUCENENET-287 at 11/25/09 8:22 PM:
----------------------------------------------------------
I liked that SegmentInfos3.patch. To avoid a type casting exception
{code}
SegmentInfos objToCompare = obj as SegmentInfos;
if (objToCompare == null) return false;
{code}
can be used.
DIGY
was (Author: digydigy):
I liked that SegmentInfos3.patch
DIGY
> TestIndexWriterReader.TestUpdateDocument
> ------------------------------------------
>
> Key: LUCENENET-287
> URL: https://issues.apache.org/jira/browse/LUCENENET-287
> Project: Lucene.Net
> Issue Type: Bug
> Reporter: Andrei Iliev
> Attachments: SegmentInfos.patch, SegmentInfos2.patch, SegmentInfos3.patch
>
>
> SegmentInfos is derived from ArrayList. So Equals and GetHashCode should behave as java ArrayList (see LUCENENET-284).
> After that patch TestIndexWriterReader.TestUpdateDocument is passed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (LUCENENET-287)
TestIndexWriterReader.TestUpdateDocument
Posted by "Andrei Iliev (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENENET-287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12782653#action_12782653 ]
Andrei Iliev commented on LUCENENET-287:
----------------------------------------
Don't forget to override GetHashCode., e.g
public override int GetHashCode()
{
int h = 1;
for (int i = 0; i< this.Count; i++)
{
SegmentInfo si = (this[i] as SegmentInfo)
h = 31 * h + (si == null ? 0 : si.GetHashCode());
}
return h;
}
> TestIndexWriterReader.TestUpdateDocument
> ------------------------------------------
>
> Key: LUCENENET-287
> URL: https://issues.apache.org/jira/browse/LUCENENET-287
> Project: Lucene.Net
> Issue Type: Bug
> Reporter: Andrei Iliev
> Attachments: SegmentInfos.patch, SegmentInfos2.patch, SegmentInfos3.patch
>
>
> SegmentInfos is derived from ArrayList. So Equals and GetHashCode should behave as java ArrayList (see LUCENENET-284).
> After that patch TestIndexWriterReader.TestUpdateDocument is passed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (LUCENENET-287)
TestIndexWriterReader.TestUpdateDocument
Posted by "Eran Sevi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENENET-287?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eran Sevi updated LUCENENET-287:
--------------------------------
Attachment: SegmentInfos3.patch
Added SegmentInfos3.patch.
All TestIndexWriterReader tests passed.
For now I left the inheritance from ArrayList and implemented a simple override of the Equals method from ArrayList.
A better solution might increase performance or be more elegant.
Eran.
> TestIndexWriterReader.TestUpdateDocument
> ------------------------------------------
>
> Key: LUCENENET-287
> URL: https://issues.apache.org/jira/browse/LUCENENET-287
> Project: Lucene.Net
> Issue Type: Bug
> Reporter: Andrei Iliev
> Attachments: SegmentInfos.patch, SegmentInfos2.patch, SegmentInfos3.patch
>
>
> SegmentInfos is derived from ArrayList. So Equals and GetHashCode should behave as java ArrayList (see LUCENENET-284).
> After that patch TestIndexWriterReader.TestUpdateDocument is passed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.