lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hoss Man (JIRA)" <>
Subject [jira] Commented: (SOLR-1073) StrField should allow locale sensitive sorting
Date Tue, 28 Apr 2009 23:50:30 GMT


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:
>             Project: Solr
>          Issue Type: Improvement
>         Environment: All
>            Reporter: Sachin
>         Attachments:
> 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:

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

View raw message