#community-help

Typesense and Firebase Integration Troubleshooting

TLDR Bobby struggled with getting data to Typesense from Firebase. After sharing his logs and settings screenshots, Jason helped him fix the path configuration and suggested ways to successful re-trigger a backfill. This resolved the issue.

Powered by Struct AI
+11
22
17mo
Solved
Join the chat
Apr 19, 2022 (17 months ago)
Bobby
Photo of md5-5b16627380ba9c6ff7a40a700b7b974c
Bobby
02:51 AM
Hi, I am trying to integrate typesense into my project using Firebase. i added the extension in firebase, the backfill ran and sent data to typsense i can see 55mb bandwidth used, but the collection is not showing up. I have created the collection too. Also, i am able to make a request from client no problems. So just having issues getting data to typesense. Anyone know of common problems with this? Thanks
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
02:53 AM
Bobby You should hopefully see more detailed info in the function logs, for the extension. Could you share the last several lines?
Bobby
Photo of md5-5b16627380ba9c6ff7a40a700b7b974c
Bobby
02:54 AM
9:20:54.742 PM
outlined_flaggmp_mods
ext-firestore-typesense-search-backfillToTypesenseFromFirestore
Function execution started


9:20:54.750 PM
infogmp_mods
ext-firestore-typesense-search-backfillToTypesenseFromFirestore

Backfilling fields in Firestore documents from typesense into Typesense Collection wurkers on 8vhgabwrmky6pz7cp-1.a1.typesense.net


9:20:54.842 PM
infogmp_mods
ext-firestore-typesense-search-backfillToTypesenseFromFirestore

Done backfilling to Typesense from Firestore

9:20:54.843 PM
outlined_flaggmp_mods
ext-firestore-typesense-search-backfillToTypesenseFromFirestore

Function execution took 101 ms. Finished with status: ok
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
02:57 AM
Backfill seems to have worked fine according to those logs. May I know how many documents are in your Firestore collection, and how many show up in Typesense after you run the backfill?
Bobby
Photo of md5-5b16627380ba9c6ff7a40a700b7b974c
Bobby
02:59 AM
I think I put the back fill in wrong spot in firestore. is it supposed to go inside the collection you want to backfill, or inside the root firestore?

no documents show up from firebase, I added a few manually to typesense to check client side was working.
02:59
Bobby
02:59 AM
backfilling 100 documents
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
02:59 AM
> is it supposed to go inside the collection you want to backfill, or inside the root firestore?
You'd create a new Firestore collection called "typesense_sync" and put the backfill flag there
03:00
Jason
03:00 AM
Also to re-trigger a backfill, you want to delete that key completely and then create it again. Just toggling the values doesn't work
Bobby
Photo of md5-5b16627380ba9c6ff7a40a700b7b974c
Bobby
03:00 AM
ok. thats what i did
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
03:01 AM
The other thing to check is if the Firestore collection name in the extension settings is correct
Bobby
Photo of md5-5b16627380ba9c6ff7a40a700b7b974c
Bobby
03:01 AM
ok. I deleted the typsense_sync and readded it. that was the second backfill I tried.
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
03:04 AM
Does adding a new document to the Firestore collection sync things over, or is it just the backfill?
Bobby
Photo of md5-5b16627380ba9c6ff7a40a700b7b974c
Bobby
03:07 AM
just backfill worked. I tried adding a new document and it did not run the other function.
03:07
Bobby
03:07 AM
well backfill function ran but no data i mean
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
03:13 AM
I suspected that it might have to do with a new version of the extension released a few hours ago, but I just tried running the backfill function on a test project and it imported the docs successfully into Typesense...
03:14
Jason
03:14 AM
Usually there's a log line that says how many documents were found for import when running backfill. And I don't see it in what you shared... So it's likely that the Firestore collection path is not configured right in the extension settings. Could you share a screen shot of your extension configuration page?
Bobby
Photo of md5-5b16627380ba9c6ff7a40a700b7b974c
Bobby
03:16 AM
I just uninstalled and trying reinstall but these are images i took before of all settings.
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
03:17 AM
Ah yes, the "Firestore Collection Path" is set to "typesense". You probably wanted to set that to "wurkers" if your intention is to sync that Firestore collection
Bobby
Photo of md5-5b16627380ba9c6ff7a40a700b7b974c
Bobby
03:19 AM
ok. I will try that
03:27
Bobby
03:27 AM
I think this is working now, just getting schema errors, but i can handle those. Thank you. So far this is pretty easy to implement.
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
03:32 AM
That's great to hear! Thank you for the feedback!
Bobby
Photo of md5-5b16627380ba9c6ff7a40a700b7b974c
Bobby
03:48 AM
Your welcome. Definitely working now, getting results to client from firebase now.
+11