#community-help

Updating Schemas and Managing Collections in Typesense

TLDR Davide asked about updating schemas without reloading data, Jason recommended using aliases to point to timestamped collections and dropping old collections after an update.

Powered by Struct AI

1

6
31mo
Solved
Join the chat
May 19, 2021 (31 months ago)
Davide
Photo of md5-5a7e6fd9a070eac5034a6034f0dc38b1
Davide
01:15 AM
Is there an easy way to update a schema without reloading all data (eg: changing a field to a facet)?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
01:23 AM
Not at the moment unfortunately, but updating a collection's schema is on our roadmap.

In the meantime, I'd recommend using aliases (similar to symlinks in linux) to point to a timestamped collection and using that alias for searches. When you need to update the schema, you'd create a new collection with the latest timestamp in its name, index the data, and then finally switch the alias to point to the new collection.
Davide
Photo of md5-5a7e6fd9a070eac5034a6034f0dc38b1
Davide
01:25 AM
ah, cool! Only question is what happens once I have 100k indexes? Can I purge them?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
01:25 AM
Once you update the collection alias to the latest one, you'd finally want to drop the old collection
Davide
Photo of md5-5a7e6fd9a070eac5034a6034f0dc38b1
Davide
01:26 AM
Gotcha, this is fantastic, thanks

1