algolia / firestore-algolia-search

Apache License 2.0
112 stars 35 forks source link

Unable to Import Records Into Algolia #46

Closed foodlyhenry closed 3 years ago

foodlyhenry commented 3 years ago

Hi, I have a very similar issue to: https://github.com/algolia/firestore-algolia-search/issues/43#event-4954001620 and https://github.com/algolia/firestore-algolia-search/issues/42#issuecomment-869508635

Ignoring the error messages like for issue #42 and using the one liner command provided in #43 did not solve my problem.

Here is the command I ran: LOCATION=us-central1 ALGOLIA_APP_ID=D********* ALGOLIA_API_KEY=b****************0 ALGOLIA_INDEX_NAME=dev_foodly COLLECTION_PATH=Restaurants/{restaurantId}/Locations FIELDS=restaurantName GOOGLE_APPLICATION_CREDENTIALS=foodlyServiceAccountKeyDev.json npx firestore-algolia-search@0.4.1 And this is my output:

{"severity":"WARNING","message":"Warning, FIREBASE_CONFIG and GCLOUD_PROJECT environment variables are missing. Initializing firebase-admin will fail"}
{"algoliaAppId":"D7MMB2JA20","algoliaAPIKey":"********","algoliaIndexName":"dev_foodly","collectionPath":"Restaurants/{restaurantId}/Locations","fields":"restaurantName","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
✨  Done in 41.50s.
smomin commented 3 years ago

I am not seeing any error message but warnings. Can you send me a screen shot of your Algolia API key permissions? (make sure to black out sensitive data)

foodlyhenry commented 3 years ago

Here it is, sorry for the late reply. Is this what you needed? Screen Shot 2021-07-08 at 3 00 23 PM

smomin commented 3 years ago

I am curious if your collection path is incorrect. Can you try changing it to Restaurants?

foodlyhenry commented 3 years ago

Changing to Restaurants does import the records to Algolia, However what I want is to import the Locations (Restaurants/{restaurantId}/Locations) into Algolia to search.

Also, I forgot to mention that Algolia is properly importing records into the index, however this only happens when I create a new Restaurant not when running the command.

For example If i created a new Document inside 'Restaurants/{restaurantId}/Locations', then it is imported into Algolia automatically as expected.

smomin commented 3 years ago

understood. the issue is on the import script and not the real time indexing. will take a look.

smomin commented 3 years ago

This code was merged with the new version 0.5.0.