firestore-typesense-search icon indicating copy to clipboard operation
firestore-typesense-search copied to clipboard

Feature request: configuration field to call a transform function

Open StevenH86 opened this issue 10 months ago • 1 comments

Hey team, I'm in the process of migrating from Algolia to typesense and all is going well, however, the Algolia extension allows us to provide the name of a another function that can transform our document data before writing it to the Algolia index.

This would be extremely useful to have available in the typesense extension. We use it to modify one of the ID's as we are indexing a subcollection that exists nested in multiple places e.g. programs/{programId}/program-users/{userId}. As the docs we are indexing are keyed by the userId we need to append the programId as a suffix to prevent records overwriting each other.

I believe something like a transform function would be useful for a bunch of other lodged issues where people want to exclude records with certain values from their typesense collection. Supporting a returned object like below would be extremely useful.

{ payload: { ... data to sync }, docId: 'someId', action: 'skip' // 'skip' | 'sync' | 'delete' }

This would allow us to have more control over what goes into our typesense collections.

Cheers

StevenH86 avatar Apr 24 '24 09:04 StevenH86

I'd definitely appreciate a PR for this

jasonbosco avatar Apr 29 '24 18:04 jasonbosco