#community-help

Discussing Firestore Extension and Collection Schema in Typesense

TLDR Loic asks about settings in Firestore Extension and experiences issues with the collection schema in Typesense. Discussion with Jason is ongoing.

Powered by Struct AI
sweat_smile1
Aug 30, 2023 (1 month ago)
Loic
Photo of md5-3a88a602e4aba6a18b4a6c6985fcf08c
Loic
11:18 PM
Jason Hi Jason,
In Firesbase Extension, the doc says to set "Yes" in both cases, is this normal?
Adds a new parameter that controls whether a nested Firestore document is flattened by the extension, or sent as is to Typesense.
If you are running Typesense Server v0.23.1 or below, set "Flatten Nested Documents" to "Yes" (since indexing nested fields is not supported in these versions).
If you are running Typesense Server v0.24 or above, set "Flatten Nested Documents" to "Yes" (since indexing nested fields is natively supported in Typesense in these versions).
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
11:19 PM
Hmm, may I know where you see this?

I did fix the typo in the changelog here: https://github.com/typesense/firestore-typesense-search/blob/master/CHANGELOG.md#version-100
Loic
Photo of md5-3a88a602e4aba6a18b4a6c6985fcf08c
Loic
11:20 PM
Update extension version
Image 1 for Update extension version
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
11:21 PM
Looks like the changelogs in the Firebase UI don't get updated after submitting the version to the extension hub
Loic
Photo of md5-3a88a602e4aba6a18b4a6c6985fcf08c
Loic
11:23 PM
Got you, at least the tooltip on the textfield to actually pick Yes or No shows the good info 👍
sweat_smile1
Sep 06, 2023 (3 weeks ago)
Loic
Photo of md5-3a88a602e4aba6a18b4a6c6985fcf08c
Loic
04:09 PM
Jason Hi Jason,
I have a problem with my collection schema.
I have a class as below:
04:09
Loic
04:09 PM
class Temperatures {
    String brokerId;
    List<PickedProduct> pickedProduct;

    Temperatures({
        required this.brokerId,
        required this.pickedProduct,
    });

}

class PickedProduct {
    String uniqueTicker;
    int brokerRetailPrice;
    String brokerCurrency;
    String brokerDescription;
    bool showOriginalPictures;
    bool showGenericPictureFirst;

    PickedProduct({
        required this.uniqueTicker,
        required this.brokerRetailPrice,
        required this.brokerCurrency,
        required this.brokerDescription,
        required this.showOriginalPictures,
        required this.showGenericPictureFirst,
    });

}
04:09
Loic
04:09 PM
That gives a Json like this:
04:09
Loic
04:09 PM
{
  "brokerId": "abc",
  "pickedProduct": [
        {
            "uniqueTicker" : "abc",
            "brokerRetailPrice" : 100, 
            "brokerCurrency" : "abc",
            "brokerDescription" : "abc",
            "showOriginalPictures" : true,
            "showGenericPictureFirst" : true
        }
    ]
}
04:10
Loic
04:10 PM
How to store the List<pickedProduct> in the collection schema?
04:10
Loic
04:10 PM
I have tried the Object[] but it doesn't seem to be the good solution
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
04:55 PM
object[] would indeed be the way to store that object, since it's an array of objects. Could you elaborate on why it's not a good solution?