algolia / firestore-algolia-search

Apache License 2.0
112 stars 35 forks source link

Unable to Import Existing Records Into Algolia #59

Closed iamafzalhassan closed 3 years ago

iamafzalhassan commented 3 years ago

LOCATION=us-central1\ PROJECT_ID=nexiev\ ALGOLIA_APP_ID=\ ALGOLIA_API_KEY=\ ALGOLIA_INDEX_NAME=ev\ COLLECTION_PATH=ev\ GOOGLE_APPLICATION_CREDENTIALS=nestra-firebase-adminsdk-jufxu-6f8cfa91bb.json\ npx firestore-algolia-search

I ran the above command in Powershell. But I got the following error and existing records were not imported.

WARNING: The backfill 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 (C:\Users\Afzal\AppData\Roaming\npm-cache\_npx\7620\node_modules\firestore-algolia-search\lib\import\index.js:72:65)\n at C:\Users\Afzal\AppData\Roaming\npm-cache\_npx\7620\node_modules\firestore-algolia-search\lib\import\index.js:80:9\n at Interface._onLine (readline.js:327:5)\n at Interface._line (readline.js:658:8)\n at Interface._ttyWrite (readline.js:999:14)\n at ReadStream.onkeypress (readline.js:205:10)\n at ReadStream.emit (events.js:315:20)\n at emitKeys (internal/readline/utils.js:335:14)\n at emitKeys.next ()\n at ReadStream.onData (readline.js:1133:36)"}

Lucas-L commented 3 years ago

Hello, having the same issue with WSL (ubuntu) , any luck on this @imakevirtual ?

Haroenv commented 3 years ago

There's no stack trace, but do you have collectionFields set? https://github.com/algolia/firestore-algolia-search/blob/dc264bec3ba2b2f9b8b7263a96686707d42928de/functions/src/import/index.ts#L80

iamafzalhassan commented 3 years ago

Hello, having the same issue with WSL (ubuntu) , any luck on this @imakevirtual ?

@Lucas-L The way I ran the command was wrong. What I did to resolve the problem is,

by-theo commented 3 years ago

Same issue on M1 Mac Solution doesn't work for me

by-theo commented 3 years ago

Okay it works when used in a single line