You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Hoss Man (JIRA)" <ji...@apache.org> on 2013/02/26 04:18:20 UTC

[jira] [Updated] (SOLR-4504) CurrencyField treats docs w/o value the same as having a value of 0.0

     [ https://issues.apache.org/jira/browse/SOLR-4504?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hoss Man updated SOLR-4504:
---------------------------

    Attachment: SOLR-4504.patch

The problem is that unlike a simple TrieField that uses FieldCacheRangeFilter (which knows about docs that have no value) CurrencyField needs to use a ValueSourceRangeFilter wrapped arround the CurrencyValueSource that computes the exchange rate.

Attached patch fixes things by combining it with a FieldValueFilter and updates the existing range query test to include lots of docs with no field value.  This seemed to expose another bug in CurrencyValueSource where you could get an ArrayIndexOutOfBoundsException because the ord(doc) value of the currency for a doc w/o values would be negative, which i fixed with an short-circut delegating to amounts.exist(doc)

(4.1 users, even those with docs missing the currency field, wouldn't ever get the ArrayIndexOutOfBoundsException because in 4.1 the FieldCache.DocTermsIndex used "0" -- instead of "-1" as it is returned by ord() now with the new DocValues APIs)
                
> CurrencyField treats docs w/o value the same as having a value of 0.0
> ---------------------------------------------------------------------
>
>                 Key: SOLR-4504
>                 URL: https://issues.apache.org/jira/browse/SOLR-4504
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Hoss Man
>         Attachments: SOLR-4504.patch
>
>
> As noted by Gerald Blank on the mailing list, CurrencyField queries treat documents w/o any value the same as documents wit ha value of 0.0f.
> observe that using the example solr schema, with any number of docs indexed, this query matches all docs even though no docs have any values at all for hte specified field...
> {noformat}
> http://localhost:8983/solr/select?q=hoss_c:[*%20TO%20*]
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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