Closed jdmeyer3 closed 2 years ago
I don't really understand you question. Can you provide more detail?
With the extension, I can specify a transformer function to manipulate the data before it is sent to Algolia. With the bulk load, is there any way to specify a function or use some transform code before sending the data to Algolia.
You should be able to do an import process executed on your local instance using the command below. The script will call the Transform function to do any preprocessing before sending to Algolia. I hope this helps.
LOCATION=<location of cloud function>\
PROJECT_ID=<firebase-project-id>\
ALGOLIA_APP_ID=<algolia-app-id>\
ALGOLIA_API_KEY=<algolia-api-key>\
ALGOLIA_INDEX_NAME=<algolia-index-name>\
COLLECTION_PATH=<firebase-collection-path>\
FIELDS=<comma separated fields params>\
TRANSFORM_FUNCTION=<cloud-function>\
GOOGLE_APPLICATION_CREDENTIALS=<location of the service json on local environment>\
npx firestore-algolia-search
You should be able to find the above command prepopulated with your setting in the Algolia firebase extension configuration.
Closing due to no response. Please reopen if the issue still exists.
I'm utilizing the Firebase extension to synchronize my Firestore collection with Algolia search. As part of this process, I've set up a transformation function to replace category IDs in my Firestore documents with the actual category names before they're indexed in Algolia.
I've observed that the transformation works perfectly when I modify individual Firestore documents. The changes reflect correctly in Algolia search results. However, when I save changes in the Firebase extension settings, it seems that the transformation is not triggered on all documents. My assumption is that the transform function is only invoked on individual document changes and not when bulk updates are made through the extension.
Is this the intended behavior? If so, is there a recommended way to ensure transformations are applied consistently, even during bulk updates? Or is there something else I might be missing in my configuration?
Thank you for your assistance.
Is it possible to transform the data before loading it to Algolia when using the script
npm firestore-algolia search
?