Hi,
 We are indexing a set objects with fields like objectName,
objectDescription etc. All the objects have objectName specified in English
language; some objects also have their name specified in an additional
language like French and indexed to objectName_fr field.

When we query from SOLR, we want to display objects sorted by objectName.
If the logged-in user's locale is French, we want to display french object
name for objects that have this and display english language name for rest
of the objects.

For sorting in ascending order, I specified: "objectName_collated_fr asc,
objectName_lowercase asc" in SOLR query. Here "objectName_lowercase" is of
field type "lowercase" (with KeywordTokenizerFactory &
LowerCaseFilterFactory) and "objectName_collated_fr" is of field type "
ICUCollationField" with locale="fr".

When sorting in ascending order, I noticed that all objects with English
only object names got displayed first and then those objects with English &
French names came at the end. I am assuming that the objects with English
only object names came first because these didn't have values for the
french field and treated equivalent to null/empty values for french field.

But when sort order is changed to descending (objectName_collated_fr desc,
objectName_lowercase desc), objects with English & French came first and
the objects; again the reason is same as the one mentioned above.

Let me know if this behavior is correct.

Thanks,
Vasu

Reply via email to