You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Cao Manh Dat (JIRA)" <ji...@apache.org> on 2017/03/14 07:09:41 UTC

[jira] [Comment Edited] (SOLR-10266) invalid assumptions about doc order in TestPointFields - possibly masking real bug in {{DatePointField}} ?

    [ https://issues.apache.org/jira/browse/SOLR-10266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15923703#comment-15923703 ] 

Cao Manh Dat edited comment on SOLR-10266 at 3/14/17 7:08 AM:
--------------------------------------------------------------

[~hossman] I checked the test and you actually right. The test is badly written, It should change from 
{code}
assertQ(req("q", "*:*", "fl", "id, " + dvFieldName, "sort", "product(-1," + dvFieldName + ") asc"),
{code}
to
{code}
assertQ(req("q", "*:*", "fl", "id, " + dvFieldName, "sort", "product(-1,ms(" + dvFieldName + ","+baseDate+")) desc")
{code}

But It does not mean that 
bq. the sorting by function on DatePointField may not be working?
Because {{ProductFloatFunction}} is used for {{product()}} so the long value ( of date field ) will be converted into float before doing multiplication. It lead into losing some last decimals. So they will end up with same value {{7.8973554E11}}


was (Author: caomanhdat):
[~hossman] I checked the test and you actually right. The test is badly written, It should change from 
{code}
assertQ(req("q", "*:*", "fl", "id, " + dvFieldName, "sort", "product(-1," + dvFieldName + ") asc"),
{code}
to
{code}
assertQ(req("q", "*:*", "fl", "id, " + dvFieldName, "sort", "product(-1,ms(" + dvFieldName + ","+baseDate+")) desc")
{code}

But It does not mean that 
bq. the sorting by function on DatePointField may not be working?
Because {{ProductFloatFunction}} for {{product()}} so the long value ( of date field ) will be converted into float which lead into losing some last decimals. So they will end up with same value {{7.8973554E11}}

> invalid assumptions about doc order in TestPointFields - possibly masking real bug in {{DatePointField}} ?
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-10266
>                 URL: https://issues.apache.org/jira/browse/SOLR-10266
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Hoss Man
>         Attachments: SOLR-10266.patch
>
>
> There are a bunch of places in TestPointFields where {{assertQ()}} is used to verify that many docs match a query and have particular values -- but because of how the XPath expressions are written there are implicit assumptions about the order of the docs matching the order they were added to the index, which isn't always garunteed depending on the randomized merge policy that might be used.
> while fixing this, i also uncovered what _appears_ to be a more serious bug with {{DatePointField}} function sorting (either that, or a badly written test) that we need to get to the bottom of.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org