In TypeSense Cloud, Is there a way to edit the Col...
# community-help
l
In TypeSense Cloud, Is there a way to edit the Collection Schema?
k
We don't have a way to modify the schema at the moment but that's on our backlog. You can just create a new collection and swap to it. The Collection Alias features makes this really easy to do without updating your app configuration: https://typesense.org/docs/0.21.0/api/collection-alias.html
l
Hi @Kishore Nallan, thank you for your message. I see. I am using Firebase with the Typense extension. In the documentation:
Copy code
3. Backfilling data (optional)
This extension only syncs data that was created or changed in Firestore, after it was installed. In order to backfill data that already exists in your Firestore collection to your Typesense Collection:
Create a new Firestore collection called typesense_sync through the Firestore UI.
Create a new document with the ID backfill and contents of {trigger: true}
This will trigger the backfill background Cloud function, which will read data from your Firestore collection and create equivalent documents in your Typesense collection
However, there is no way to retrieve the documents from a Firebase collection NOT named ``typesense_sync`` ?
*existing documents before the creation of this new TypeSense Collection Alias
j
@Loïc typesense_sync is just a way to trigger the backfill. The actual collection name that’s used is the name you entered when installing the extension
l
Hi @Jason Bosco, ok I will try! In the typesense dart package, is there a
result
object that manipulate the search result Map<String, dynamic>?
Copy code
Future<Map<String, dynamic>> search(
      Map<String, dynamic> searchParameters) async {
    return await _apicall.get(
      '$_endPoint/search',
      queryParams: searchParameters,
      shouldCacheResult: true,
    );
  }
h
Hey @Loïc, unfortunately there isn't right now. But providing sound types is something I'm considering to implement in future.
l
👍 thank you @Harpreet Sangar
@Jason BoscoI just read the doc with Alias. It is great but you actually need to implement that setup at the very beginning if you want to be able to update/change the collection data later on. Good to know though!
j
You can create an alias later on, point it to an existing collection, and then use that alias in the Firebase extension for the collection name
l
@Jason Bosco I have a Firebase GeoPoint that I want to store as Geopoint but the Firebase function gives me the error on the screenshot below
Copy code
{
      "facet": false,
      "index": true,
      "name": "locationGeoCode",
      "optional": false,
      "type": "geopoint"
    },
message has been deleted
j
@Loïc The Firebase geopoint is different from the Typesense geopoint. So in Firestore you'll have to create an additional array field just for Typesense which contains the field in [lat,lng] format and sync that over to Typesense.
Essentially add a new field called for eg:
locationGeoCodeArray: [1, 1]
in Firestore and sync that to Typesense and use that to filter as well
l
@Jason Bosco Got it, thank you 👍
👍 1
@Jason Bosco For Timestamp stored in Firebase, do you also need to duplicate in int64?
j
Yup, that's exactly right!
l
👍