You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Shalin Shekhar Mangar (JIRA)" <ji...@apache.org> on 2008/08/14 14:31:44 UTC

[jira] Commented: (SOLR-700) test failures because of wrong/unexpected locale

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

Shalin Shekhar Mangar commented on SOLR-700:
--------------------------------------------

Thanks Stefan.

I was thinking about having a locale attribute on each field element in data-config.xml. We should modify the NumberFormatTransformer#transformRow method to read each field's locale attribute. Every field's attributes are exposed as a map, so we should have:
{code}
// Each locale must be of format lang:country e.g. en-US
String locale = fld.get("locale");
// Create a locale object based on  language and country and pass it to the process method
{code}

That way locale will be configurable on a per-field basis and no EntityProcessor would need to be modified.

> test failures because of wrong/unexpected locale
> ------------------------------------------------
>
>                 Key: SOLR-700
>                 URL: https://issues.apache.org/jira/browse/SOLR-700
>             Project: Solr
>          Issue Type: Bug
>          Components: contrib - DataImportHandler
>    Affects Versions: 1.3
>            Reporter: Stefan Oestreicher
>            Priority: Minor
>         Attachments: handler.dataimport.NumberFormatTransformer-locale.patch..txt, handler.dataimport.TestNumberFormatTransformer-locale.patch.txt, schema.DateField-locale.patch.txt
>
>
> The following unit tests fail if they're run with a german locale:
> org.apache.solr.schema.LegacyDateFieldTest
> org.apache.solr.schema.DateFieldTest
> org.apache.solr.handler.dataimport.TestNumberFormatTransformer
> The DateField tests fail because the expected decimal format uses "." as separator but the actual result is formatted using the "," separator.
> This happens because the ISO8601CanonicalDateFormat class which is defined inside the DateField class doesn't specify the US locale when creating the formatter used for milliseconds. 
> Patch: schema.DateField-locale.patch.txt
> TestNumberFormatTransformer failed because handler.dataimport.NumberFormatTransformer uses a NumberFormatter which relies on the system locale. But I think in this case it's intentional, so I modified the test case to use the grouping separator of the system locale. 
> Patch: handler.dataimport.TestNumberFormatTransformer-locale.patch.txt

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