-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
I discovered that a custom mapping defined with typesenseType like this:
updatedAt: {
graphQlType: 'Int',
typesenseType: 'int64', // use uint64, otherwise milliseconds wont fit
valueFn: ({ variant }) => {
return variant.product.updatedAt.valueOf() ?? new Date().valueOf();
},
outputFn: values => values?.[0] ?? 0,
},Can't be used for sorting:
function sortableFields(): SortableField[] {
return [
{
name: 'customMapping_updatedAt',
alias: 'updatedAt',
},
];
}I was debugging the fields that are available while checking the schema and customMapping_updatedAt didn't appear in it.

If I remove the custom sorting and debug the documents getting created, I can see though that customMapping_updatedAt is used.
So I assume that The customMapping fields using typesenseType are somehow added after checking the sort schema.
My usecase: I want to sort products by "latest".
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels