algolia / firestore-algolia-search

Apache License 2.0
112 stars 35 forks source link

Subcollection syncing with different parent collections getting mixed up #207

Closed davidoort closed 3 months ago

davidoort commented 5 months ago

I have a subcollection for two parent collections: chats/{chatId}/messages flick/{flickId}/messages

When I create a new extension and provide this path: flick/{flickId}/messages, documents from the chats parent collection also show up. This is not how I expected it to work.

smomin commented 5 months ago

hey @davidoort

I assume this happens during full indexing. If so, this is a limitation in the Firebase api. I have to use the collectionGroup api and I parse the collection path to get the last part which in your case is messages. This then gets all the messages collection. I will check with the Firebase team again to see if they have a better approach now.

Sajid

davidoort commented 5 months ago

ah I see, yeah that would be great. Otherwise you'll have to iterate over all documents in the parent collection

smomin commented 3 months ago

Since there isn't anything I can do on this ticket, I am going to close it.