I use this field definition for a sort field:

<fieldType name="sort" class="solr.ICUCollationField" locale="" numeric="true" 
strength="secondary" alternate="shifted" sortMissingLast="true" />

This seems to work well.

-Andrew

> On 10 Nov 2022, at 11:06, Netta Steinberg <nsteinb...@dalet.com> wrote:
> 
> Hi all,
> 
> I want to sort value alphabetically, but also numerically.
> Example:
> I want that the following items
> A1
> B4
> A2
> A19
> B10
> 
> Will be sorted in the following order
> A1
> A2
> A19
> B2
> B19
> 
> So values that start with A will appear before values that start with B, but 
> also A2 will appear before A19, because the numerical value of 19 is greater 
> then the numerical value of 2.
> I've seen similar questions in StackOverflow, but the suggestions were to pad 
> the values with zeros (so, e.g. A2 will become A02) but this is not an option.
> All
> 
> Thanks,
> Netta
> 

Reply via email to