You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by laimis <gi...@git.apache.org> on 2015/04/26 13:43:46 UTC

[GitHub] lucenenet pull request: make sure to invoke appropriate CompareVal...

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 <la...@gmail.com>
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] lucenenet pull request: make sure to invoke appropriate CompareVal...

Posted by laimis <gi...@git.apache.org>.
Github user laimis commented on the pull request:

    https://github.com/apache/lucenenet/pull/132#issuecomment-96412864
  
    @synhershko took a look, it seems like we need it because there are places using this without explicit specification of generic type T to match what Lucene is doing (where it declares it as 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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] lucenenet pull request: make sure to invoke appropriate CompareVal...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/lucenenet/pull/132


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] lucenenet pull request: make sure to invoke appropriate CompareVal...

Posted by synhershko <gi...@git.apache.org>.
Github user synhershko commented on the pull request:

    https://github.com/apache/lucenenet/pull/132#issuecomment-96372011
  
    Good catch, will merge now
    
    Can you evaluate if we still need that non-generic class?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---