algolia / firestore-algolia-search

Apache License 2.0
112 stars 35 forks source link

Facet filter for parent id in a subcollection index #206

Open davidoort opened 7 months ago

davidoort commented 7 months ago

Hey! I'm wondering if there's a way to create a facet filter for the parent id of documents in a subcollection.

So if the Algolia Index is synced from a firestore subcollection like parent/{parentId}/child/{childId} it would be great to be able to see all documents from a certain parentId

Thanks!

David

smomin commented 7 months ago

Sure, let me think about it.

BossBele commented 5 months ago

+1 for this as it would make more sense to sync subcollections

smomin commented 5 months ago

Would you want the parent Id or the parent name?

BossBele commented 5 months ago

@smomin The parentId in parent/{parentId}/child (sample) collection path. Example, when building a multi-tenant to-do app with tasks stored in tasks/{companyID}/docs, I want to be able to get all tasks of company A, say Algolia with companyID algolia-22324. These tasks would be stored in the tasks/algolia-22324/docs collection. I hope this makes sense.

To answer your question, we want the parentId.