firestore-typesense-search icon indicating copy to clipboard operation
firestore-typesense-search copied to clipboard

Support backfill documents in subcollections

Open eysenshi opened this issue 3 years ago • 5 comments

Description

This is a request to support backfill all subcollections return from a collection group query. This could be helpful in use case like, backfill landmarks data from all cities under path: cities/{cityId}/landmarks.

eysenshi avatar Aug 27 '21 19:08 eysenshi

Note to myself: docs for listening on dynamic paths: https://firebase.google.com/docs/functions/firestore-events#wildcards-parameters

jasonbosco avatar Dec 06 '21 20:12 jasonbosco

@jasonbosco, this extension supports subcollection paths? (ie. cities/{cityId}/landmarks)

elhe26 avatar Dec 13 '21 13:12 elhe26

Subcollection like "cities/{cityId}/landmarks" worked for me on indexToTypesenseOnFirestoreWrite but not on backfill: backfillToTypesenseFromFirestore. Basically the backfill function runs without error but no record is imported.

ChauCM avatar Dec 14 '21 17:12 ChauCM

@jasonbosco Any plans to implement this? I would really need this feature!

guenth39 avatar Apr 20 '23 07:04 guenth39

The issue should be fixed by changing this line in the backfill cloud function https://github.com/typesense/firestore-typesense-search/blob/44e01a71bb881a60eea7f016ed53c577fefe2e99/functions/src/backfillToTypesenseFromFirestore.js#L43-L44 In the case of a subcollection, we have to use collectionGroup instead of collection.

guenth39 avatar Apr 20 '23 08:04 guenth39