Dominik Henneke
09/16/2025, 4:44 PM<type>-<schema-hash> (ex: "projects-eef62f97"). We create a "projects" alias that all clients use so any migrations are transparent to them. When we want to do a schema change: we create a new collection (new hash in name), fill it with all data, switch the alias to it, and delete the old one. This works perfectly for normal searches.
But now we want to use joins. Our current idea was that we also reference the collection name in the respective schema to keep the references clean:
projects-<ver1>: [{ type: "string", name: "id" }, ...]
documents-<ver1>: [{ type: "string", name: "projectId", reference: "projects-<ver1>" }]
But now, when we want to include the data from the other collection we need to do include_fields=$projects-<ver1>(*) meaning the client needs to be aware of the name of the hash-collection name. But we do want to avoid that with the before mentioned alias setup. What are our options?Alan Martini
09/16/2025, 9:06 PMDominik Henneke
09/17/2025, 5:08 AMHarpreet Sangar
09/17/2025, 7:48 AMinclude_fields=$projects-<ver1>(*) here instead of hash name and it would work fine.
When we want to do a schema change: we create a new collection (new hash in name), fill it with all data, switch the alias to it, and delete the old one.The only caveat is that now you'll have to also re-index the collection that has the
reference field when you re-index the referenced collection.
https://typesense.org/docs/29.0/api/joins.html#using-aliases-with-joinsDominik Henneke
09/17/2025, 7:50 AMHarpreet Sangar
09/17/2025, 7:56 AMinclude_fields.
When you switch the aliases, you won't have to make any changes to the include_fields since it'll also be affected by the alias change.Dominik Henneke
09/17/2025, 8:15 AMHarpreet Sangar
09/17/2025, 8:18 AMreference parameter of the field but you can provide the alias name when querying.Dominik Henneke
09/17/2025, 8:19 AMHarpreet Sangar
09/17/2025, 8:20 AMDominik Henneke
09/17/2025, 8:21 AMDominik Henneke
09/17/2025, 8:23 AMHarpreet Sangar
09/17/2025, 8:49 AM