GitHub user laimis opened a pull request:
https://github.com/apache/lucenenet/pull/132
make sure to invoke appropriate CompareValues via FieldComparator
.NET port introduced FieldComparator that generic FieldComparator<T>
inherits from. The issue is that the CompareValues it introduced does not
properly propagate CompareValues calls to subclasses of FieldComparator<T>.
To see the bug in action, look at the failing tests in
TestTopDocsMerge.TestSort_1 or TestTopDocsMerge. TestSort_2 (does not fail
always, but can be repro with a few runs). Here is the link on TC:
http://teamcity.codebetter.com/viewLog.html?buildId=189195&tab=buildResultsDiv&buildTypeId=LuceneNet_Core#testNameId-8365680837810961892
The call invoked here:
https://github.com/apache/lucenenet/blob/master/src/Lucene.Net.Core/Search/TopDocs.cs#L207
Results in execution of:
https://github.com/apache/lucenenet/blob/master/src/Lucene.Net.Core/Search/FieldComparator.cs#L318
Instead of let's say specific FieldComparator implementation such as this:
https://github.com/apache/lucenenet/blob/master/src/Lucene.Net.Core/Search/FieldComparator.cs#L1002
FieldDoc.Fields array was put back to contain object types to match what
Lucene has since IComparable interface becomes not used with the changes.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/laimis/lucenenet fieldcomparator_fix
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/lucenenet/pull/132.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #132
----
commit 38139379ba44e582b014fe8a5817779fa112be0a
Author: Laimonas Simutis <[email protected]>
Date: 2015-04-26T11:32:17Z
make sure to invoke appropriate CompareValues via FieldComparator
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---