Michael.M
05/03/2022, 9:15 PMfirestore-typesense-search
docs is the only indication of using the emulator, but it doesn’t explain how Typesense will watch for changes to my emulator database (or is that even possible?). I am able to run the emulator, and I’m able to run a local copy of Typesense, but I’m not able to connect the two.
I understand that I could probably just make a bunch of cloud functions that watch the data, but I was hoping to get those “sync” updates automatically so I can maintain the same code between dev and production.
Thanks in advance for any help!Jason Bosco
05/03/2022, 9:26 PMJason Bosco
05/03/2022, 9:26 PMtest-params.env
using this file as an example: https://github.com/typesense/firestore-typesense-search/blob/master/test-params.local.envJason Bosco
05/03/2022, 9:27 PMMichael.M
05/03/2022, 9:46 PMMichael.M
05/03/2022, 10:08 PMnpm run emulator
within firestore-typesense-search
I receive an error that says: error: unknown option '--test-params'
I have created a test-params.env
and filled out the information. I’m unable to find any information about the --test-params option in the firebase CLI documentation. Here are the steps I took:
1. clone firestore-typesense-search
2. install npm packages
3. create test-params.env file and fill in information
4. run npm run emulator
Running the typesenseServer script worked perfectly.Jason Bosco
05/03/2022, 10:27 PMMichael.M
05/03/2022, 10:30 PMMichael.M
05/03/2022, 10:31 PMMichael.M
05/04/2022, 8:35 PM--import=...
option in the emulator script (instead of the default “books” data). However, even though my data is populating properly in the extension’s firestore instance, I am not able to retrieve it from the Typesense data store. I am running this code in a separate file:
//typesense-test.js
const Typesense = require('typesense')
async function main() {
let client = new Typesense.Client({
'nodes': [{
'host': 'localhost',
'port': '8108',
'protocol': 'http'
}],
'apiKey': 'xyz',
'connectionTimeoutSeconds': 2
})
const test = await client.collections().retrieve()
console.log(test)
}
main()
And I receive []
in the console. I have set up the test-params.env
correctly, but still nothing is populated.
I’m running both the extension emulator and the typesense server, and then I run the node typesense-test.js
in a separate location.Jason Bosco
05/04/2022, 8:38 PMJason Bosco
05/04/2022, 8:39 PMMichael.M
05/04/2022, 8:39 PMMichael.M
05/04/2022, 9:23 PMMichael.M
05/04/2022, 9:24 PMJason Bosco
05/04/2022, 9:24 PMMichael.M
05/04/2022, 9:26 PM