Avi Aggarwal
07/23/2025, 2:14 PMdefault_sorting_field
of an existing collection to "id"
.
The reason is: I want to enable sorting on my custom field sku
, but as far as I understand, I need to drop and re-add the field to set sort: true
. Since I have a production website with hundreds of thousands of documents, reindexing would take a lot of time and isn't ideal.
As a workaround, I was wondering if I can set the default_sorting_field
to "id"
instead. Is there a way to update this without recreating the entire collection?
Any suggestions or best practices would be greatly appreciated!
Thanks in advance!Fanis Tharropoulos
07/23/2025, 2:46 PMid
field as a sortable field. You'll have to create an Alias, point the alias to the original collection, create a new one, index the documents there, update the Alias to point to the new collection, and drop the old oneAvi Aggarwal
07/23/2025, 2:49 PM