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

Hoss Man commented on SOLR-1073:
--------------------------------

The patch seems ok to me, ideally it should validate the Locale during init and 
fail if it doesn't exist, but that doesn't seem like a show stopper.  I'm 
personally not comfortable committing it without a basic test (Locale stuff is 
tricky, it would be good to know we aren't tickling some weird Lucene-Java bug 
in an odd way).  

The only other big catch in my mind is that this new class doesn't respect the 
sortMissingLast  & sortMissingTrue options that StrField does.  We should at 
least document this in the javadocs, but ideally we should make them work as 
well.  I *think* it would be possible if we changed 
MissingStringLastComparatorSource so that it could wrap another 
SortComparatorSource (do the null checks first, then delegate).  if we managed 
to get that working, then there wouldn't be any reason for a new 
LocaleStrField, it could just be a new option on StrField.

> StrField should allow locale sensitive sorting
> ----------------------------------------------
>
>                 Key: SOLR-1073
>                 URL: https://issues.apache.org/jira/browse/SOLR-1073
>             Project: Solr
>          Issue Type: Improvement
>         Environment: All
>            Reporter: Sachin
>         Attachments: LocaleStrField.java
>
>
> Currently, StrField does not take a parameter which it can pass to ctor of 
> SortField making the StrField's sorting rely on the locale of the JVM.  
> Ideally, StrField should allow setting the locale in the schema.xml and use 
> it to create a new instance of the SortField in getSortField() method, 
> something like:
> snip:
>   public SortField getSortField(SchemaField field,boolean reverse)
>   {
> ...
>               Locale locale = new Locale(lang,country);
>               return new SortField(field.getName(), locale, reverse);
>  }
> More details about this issue here:
> http://www.nabble.com/CJKAnalyzer-and-Chinese-Text-sort-td22374195.html

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

Reply via email to