0

I have collection in firestore and i want add Firebase's Search with Algolia Extension.

Here screenshot for collection

What is the right path for indexing all announcements with subcollections here? this field

  • Can you explain "all announcements collection"? Like any collections named "announcements" including sub-collections? I don't think watching collectionGroups() is possible. – Dharmaraj Oct 25 '22 at 13:03
  • For example in announcements collection i have subcollection (e.x articles) - this subcollection have list with articles, also i have another sub collections. I want to indexing all subcollection in announcements collection (announcements/announcements announcements/articles etc) – StarLord298 Oct 25 '22 at 13:14
  • No, the extension just uses Firestore trigger to add/update documents in Algolia. – Dharmaraj Oct 25 '22 at 13:18

1 Answers1

0

From looking at the code for the Collection Path field it seems that you can specify a path to any collection. Since your announcements are in a top-level collection, the value would be announcements.

If you want to target a subcollection, that'd be three path segments, e.g. announcements/announcements/list. The second announcements in there is the ID of the document whose list subcollection to synchronize to Algolia.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • when i type announcements/ i have validation error - Firestore collection paths must be an odd number of segments separated by slashes, e.g. "path/to/collection". Can i use something seems like announcements/*/list ? – StarLord298 Oct 25 '22 at 14:04
  • 1
    Oops, that part about a trailing slash should not have been in my answer. I updated it now. --- And from what I could determine you can only specify a single collection (although you can install the extension multiple times to get multiple collections). The repo for the extension would be a good place to file a feature request: https://github.com/algolia/firestore-algolia-search – Frank van Puffelen Oct 25 '22 at 14:27