2

This is my Firestore structure:

Products(root) -> product(document) -> prices(subCollection)

The prices collection is in each product document.

According to Algolia Firebase extension instructions, this is how to define the field for indexing. But there is no example for sub-collection.

enter image description here

The current field that I have set for indexing are in the product(document) but I also want to select certain fields inside the prices(subCollection).

Is there a way to tell the Algolia Firebase extension to index certain field inside the prices sub-collection as well?

Leo
  • 23
  • 1
  • 5
  • https://github.com/algolia/firestore-algolia-search/tree/main#configuration-parameters select fields or use a transform function? – cmgchess Aug 24 '22 at 13:26
  • Hi @cmgchess Based on the github link 1. Select fields: - I am also trying to index certain field on the product(document) alongside certain field in the prices(subCollection). In the Algolia Firebase extension state how to select the fields to be index but none of the example showed how to address fields inside a sub-collection. I'll update the post to make it clearer. 2. Transform function: - I am not familiar with transform function. How do i point to the field inside the prices(subcollection) alongside the field in the product(document)? – Leo Aug 25 '22 at 04:05
  • unfortunately i have no way of testing since i do not have firebase subscription. but from the github link it shows that transform function can be used to modify the data before indexing. also says it is still at experimental stage . something like https://codeshare.io/6pnZpm can be done inside the transform – cmgchess Aug 25 '22 at 04:25
  • btw is it possible to specify fields like `category.categoryName` with a dot indicating its a field. i havent used firebase so im not sure what i said made any sense – cmgchess Aug 25 '22 at 04:27

0 Answers0