-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to add new index to old ones #632
Comments
Hi @hamidrabedi, You need to use FT.ALTER on your own currently, just like what CreateIndex does under the hood. Line 139 in 5135acd
We may also add an AlterIndex method to the repository interface. |
Yes that would be a nice feature to have, writing raw code or removing and recreating indexes doesn't seem to be a good solution. |
Sure, thanks for your interest in this.
|
Thanks for the quick response. I will begin working on this. |
Hi @rueian |
@imvtsl will there be automatic update if index fields were changed ? that would be nice |
Hi @hamidrabedi, do you have a feeling about what an automatic update API should look like? |
@rueian, suppose you have a new Redis instance and you call the create index function. If the index has not been created before, it will be created. Obviously, most of the time there will be updates to your projects, and you might need to remove or add indexes. So instead of using Regarding deleting an index, I have observed that many migration libraries do not handle deletion for various reasons, so users should handle deleting indexes themselves. However, we could have an option for it—like an argument in the This is just a basic usage that users can encounter, right now for this problem all I can do is to call flushall on initialization of my project, or handling the index Updates by connecting to the redis. I can't think of any other usecases at the moment, but I think basic auto update will do the trick for now. |
This looks like it requires a set of high-level APIs, probably including our own indexes DSL. But I am thinking of another approach, how about always creating a new index with |
Oh yeah much easier, or like dropping and recreating the index, but I think alias is better and you have lower downtime because the old index won't be affected. can delete the old index afterwards. |
So i have these indexes on the first startup:
now I need to add a new index:
But I get an index already exists error. I need my Redis to be persistent and can't flush everything.
The text was updated successfully, but these errors were encountered: