algolia / firestore-algolia-search

Apache License 2.0
112 stars 35 forks source link

Error performing backfill with Firebase extensions #66

Closed roomman closed 3 years ago

roomman commented 3 years ago

New to Algolia and trying to get the Firebase extension up-and-running, but having some issues with the backfill script.

This is the script I am running:

{"severity":"WARNING","message":"Warning, FIREBASE_CONFIG and GCLOUD_PROJECT environment variables are missing. Initializing firebase-admin will fail"}
{"algoliaAPIKey":"********","severity":"INFO","message":"Initializing extension with configuration"}

WARNING: The back fill process will index your entire collection which will impact your Search Operation Quota.  Please visit https://www.algolia.com/doc/faq/accounts-billing/how-algolia-count-records-and-operation/ for more details.  Do you want to continue? (y/N): y

{"severity":"ERROR","message":"Error when performing Algolia index TypeError: Cannot read property 'split' of undefined\n    at retrieveDataFromFirestore (/Users/simon/.npm/_npx/0ca4ecfa9810ae5b/node_modules/firestore-algolia-search/lib/import/index.js:72:65)\n    at /Users/simon/.npm/_npx/0ca4ecfa9810ae5b/node_modules/firestore-algolia-search/lib/import/index.js:80:9\n    at Interface._onLine (readline.js:340:5)\n    at Interface._line (readline.js:671:8)\n    at Interface._ttyWrite (readline.js:1015:14)\n    at ReadStream.onkeypress (readline.js:213:10)\n    at ReadStream.emit (events.js:376:20)\n    at emitKeys (internal/readline/utils.js:345:14)\n    at emitKeys.next (<anonymous>)\n    at ReadStream.onData (readline.js:1149:36)"}

I'm using the following command:

LOCATION=europe-west2\ 
PROJECT_ID=my-project-name\ 
ALGOLIA_APP_ID=0000000000\ 
ALGOLIA_API_KEY=0000000000\ 
ALGOLIA_INDEX_NAME=my_index\ 
COLLECTION_PATH=my-collection\ 
FIELDS=field1,field2,field3\ 
GOOGLE_APPLICATION_CREDENTIALS=/...json\ 
npx firestore-algolia-search

I tried reinstalling the extension and still having zero joy.

Any idea where I might be going wrong?

roomman commented 3 years ago

Found the answer here - needed to create and run a Bash Shell script.