lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Digy (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENENET-86) Nunit test for TestSort.
Date Thu, 23 Aug 2007 16:42:30 GMT

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

Digy commented on LUCENENET-86:
-------------------------------

Hi George,

case SortField.FLOAT:
                        float f1 = (float)((System.Single)docA.fields[i]); <------ Bug
                        float f2 = (float)((System.Single)docB.fields[i]);

1- Since the content of docA.fields[i] appears to be a string, it causes a TypeCast exception.
therefore i check its type in the patch and if it is a string i convert it to float.
2- After fixing the above bug, the problem docA.fields[i]==null arises. this needs another
fix.

As you say, maybe it is a ".", vs. "," issue, coming out from somewhere else.

DIGY

Oooops,
***** After 5 minutes i wrote above message, i discovered that the sample data in TestSort.cs
contains floats with  "."s  not with ","s. Replacing dots with commas solved the problem.


So, patch can wait, but i think i will be needed sometime.

DIGY







> Nunit test for TestSort.
> ------------------------
>
>                 Key: LUCENENET-86
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-86
>             Project: Lucene.Net
>          Issue Type: Bug
>            Reporter: Digy
>            Priority: Minor
>         Attachments: FieldDocSortedHitQueue.patch, Screenshot.JPG
>
>
> There are two bugs in FieldDocSortedHitQueue.LessThan method
> 1-  in  "case SortField.FLOAT:"
>      The  value of   docA.fields[i] or docB.fields[i] may be a string. In this case SupportClass.Single.Parse
should be invoked.
> 2- No null control for docA.fields[i] or docB.fields[i].

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


Mime
View raw message