Ordering results without case sensitivity

Hi,

Is it possible to order my results by a field without case sensitivity?

Currently, with the following ordering {orderings: "[my.brand.name]"}

I have the following behaviour:

  1. Honor
  2. Pixel
  3. iPhone

but would like:

  1. Honor
  2. iPhone
  3. Pixel

Thanks for your help!

Hi Thibault,

Welcome to the Prismic community.

Sorting in Prismic rest API is, by design is case sensitive, so I don't there is a way in the API to do this.

But a workaround would be to make the brand name lower-case on the content level, and then you can convert it on the JS side.

I hope that is can help,
Fares

Hi Fares,
Thank you for your answer.
With this workaround I should also store which brand name should be converted since some of them won't be capitalized.
I'd rather reorder the response received I guess or just make a compromise and keep every name with the same font case.
Thanks, it helped, even if it wasn't what I was hoping. :smirk: