Hi, I don't need help, but I'd like to point out a...
# community-help
g
Hi, I don't need help, but I'd like to point out an issue I'm having with using aliases to reindex my data in the background. My collection is for "charts", so here's what I'm trying to do: • I want two aliases:
charts_display
and
charts_insert
. My code always reads from
charts_display
and inserts new data to
charts_insert
. • When not reindexing, these should point to the same collection. • When reindexing, I create a new collection, point
charts_insert
to it, wait for the reindex to complete, point both aliases to the new collection, and delete the old collection. What I'd like to do is name the fully-indexed collection as
_charts_display
and the in-progress collection as
_charts_insert
. When I point
charts_display
to
_charts_insert
, I would want to rename it to
_charts_display
and have it replace the existing one. But currently, renaming collections is not possible. I know the alternative (as suggested in the docs) is to append something like
_june11
to the collection name and never reuse collection names. But this involves writing code to figure out what the latest name should be, which is more tedious and unnecessary if renaming is possible. The "alias" feature seems built for these situations, but it's still not ideal, since I'd want to use collection renaming anyway. I think it would make sense if collections were actually identified by an internal unique id, which is what aliases would track instead of
collection_name
. That way when collections are renamed, the id remains the same, and the alias continues to work.
k
Thank you for the detailed description. We've to see how feasible a collection rename operation is. Though we do use IDs internally there might be some places where the name could also be getting used. Can you please upvote the existing request for this feature? https://github.com/typesense/typesense/issues/344
👍 1