Hi, does Typesense offer a history of the last suc...
# community-help
m
Hi, does Typesense offer a history of the last successful index operation? It would be useful in a use case where we want to check when was the last time of a successful index to index all objects updated after this date.
👍 1
k
For keeping collections versioned across updates, I recommend using collection aliases: https://typesense.org/docs/0.20.0/api/collection-alias.html#collection-alias So instead of bulk updating the current collection, you can just create a new collection, index and update the alias to swap over instantly. You can also then drop the old collection.
Hi, does Typesense offer a history of the last successful index operation?
But to answer your question, we don't store that information.
m
Thanks a lot! Why would you say it's better to swap rather than just bulk update?
k
Bulk updates are currently slower than just indexing straight up. We're making it much faster in the next release, but even then updates are always going to be slower than inserts because updating is slower because the datastructures are optimized for new writes (generally this is the case with all search engines since you optimize for fast reads rather than writes). Alias also makes it easy to swap back in case something goes wrong. Many of our customers have found it to be very useful in practise.
Finally, when you are updating, your writes are going to be intermixed with reads against that collection, so there might be some additional latency, while indexing onto a new collection will not affect current searches. Ofc, everything I say only matters for sufficiently large collections (> 100K documents). It might not matter for small collections.
👍 1
m
Very interesting! It is pretty cool indeed to be able to rollback with this flip/flop mechanism. If I understood correctly, indexing the entire updated dataset in a new collection and swapping the alias is faster than updating the index directly?
k
Correct.
❤️ 1
m
I'm a little bit surprised but now I understand better, thanks!