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 think of 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:

This is being tracked as an open feature request.

If you have another use-case for this feature, you can 'Flag' this topic to reopen. Please use the :heart: button to show your support for the feature and check out our Feature Request Guidelines.

Hi Thibault,

Thanks for the feedback, In fact such a feature can be useful so I have marked this as feature request and sent it to our @activations-team to have additional options for sorting.

1 Like