searchkick icon indicating copy to clipboard operation
searchkick copied to clipboard

Support double indexes

Open OuYangJinTing opened this issue 2 years ago • 1 comments

First of all, thank you very much for your contribution. This gem is fantastic 🎉.

Currently, with Searchkick, you can only select one index for a model. After calling model_class.reindex, the new index is written, and Searchkick will automatically switch from the old index to the new one. This is very smart, but it comes with a prerequisite: the new index must be consistent with expectations, which cannot be guaranteed 100%. If there is a significant difference from the expected result, it may be necessary to rollback and switch back to the old index.

It would be great if Searchkick could support multiple indexes. In that case, it would be possible to divert some of the traffic to the new index first. After ensuring that the new index achieves the expected results, all the traffic can be switched to the new index~

PS: English is not my native language; please excuse typing errors.

OuYangJinTing avatar Jul 27 '23 03:07 OuYangJinTing

Building onto this idea, I'd like to be able to have multiple indices for a model, so that records for a given time range (let's say, a year) will all be together in their own index. It would make indexing and queries more efficient, and old data can be easily dropped.

emptyflask avatar Dec 01 '23 20:12 emptyflask