-
Notifications
You must be signed in to change notification settings - Fork 469
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
feat(search): Added Alias Commands to Search #2577
base: unstable
Are you sure you want to change the base?
Conversation
Is somebody able to resolve the conflict, its just the previous command is just in the same place. When I try to retrieve from origin the previous commits aren't showing up right now, sorry about that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution.
However FIELD_ALIAS is not for this purpose. It's for alias of index fields.
Also we should see the encoding design in your proposal, but I think now it's not consistent with the implementation.
@PragmaTwice I decided to switch it up the serialization on the implementation, I can include it on the pr. As for the field_alias, you can use this implementation to use index fields to look and see if the alias matches when it receives a non matching index in a command (which will be implemented in a GetAlias function). |
FIELD_ALIAS is for alias of fields. Indexes is not fields, and one index can includes several fields. Your implementation is quite confusing, if you really want to add alias of indexes, the encoding should be something like
If you put index name before alias, how do you quickly map from alias to the index name before you know the original index? I'd suggest that figure out what you want to do and how to do before writing some random code. |
Besides ADD, UPDATE and DELETE operations of alias, the most important part of aliasing is to find the corresponding index by the user-provided alias in query commands (e.g. FT.SEARCH, FT.SEARCHSQL). So we need to consider how to efficiently identify the alias and find the corresponding index in the query (in a very little runtime overhead). e.g. for index
And when we saw a query like
For index names and its metadata, we will load all of them into the memory from start instead of getting it from rocksdb every time we need it to achieve better performance. So I think for alias we should also load from start. In your design:
The index name seems repeated in both keys and values, which is not so useful. |
@PragmaTwice While the load commands happen do you think it'd be better to create a global alias map in index_manager?
|
references #2555
Added alias commands to search with unit tests in Go. (FT.ALIASADD, FT.ALIASDEL, FT.ALIASUPDATE)
Just wanted to see if this seemed fine before adding it to the actual alias functionality of the other search commands. Will create the alias functionality immediately if this PR gets merged.
Alias Subkey
ns | type | index | alias_name => index_name