-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Search: Basic shard state #1249
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
Conversation
Signed-off-by: Vladislav Oleshko <[email protected]>
Signed-off-by: Vladislav Oleshko <[email protected]>
Signed-off-by: Vladislav Oleshko <[email protected]>
src/server/search/search_accessor.h
Outdated
struct BaseAccessor : public search::DocumentAccessor { | ||
using FieldConsumer = search::DocumentAccessor::FieldConsumer; | ||
|
||
virtual SearchDocData Serialize() const = 0; |
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.
remind what Serialize
is used for?
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.
Convert underlying type to a map<string, string> to be sent as a reply, added a comment
Fixed comments. I also did some naming changes, because there will be around 5 depth levels and each one can be called index. Randomly adding words like shard or search doesn't make it more clear 🙂 I suggest calling "logical indices" just document indices (those defined by ft.create SCHEMA PREFIX...). This indicates that they don't perform search, but just keep track of documents. Shard prefix just means its per shard. Now its like this: DocIndex , ShardDocIndices -> ShardDocIndex -> [in pr2] -> FieldIndices -> BaseIndex -> e.g. NumericIndex |
Signed-off-by: Vladislav Oleshko <[email protected]>
: query{make_unique<AstExpr>(ParseQuery(query))} { | ||
bool SearchAlgorithm::Init(string_view query) { | ||
try { | ||
query_ = make_unique<AstExpr>(ParseQuery(query)); |
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.
make a comment explaining why do you try/catch.
catch the exception thrown by parser, ideally vlog it as well.
Signed-off-by: Vladislav Oleshko <[email protected]>
@romange Please re-approve, I want to rebase on this |
Context:
This is a preparation step before adding basic indices to core/search. Indices will be managed per shard, need to be constructed when the index is created with ft.create and need to be updated when new entries are added/deleted. Indices will store integer codes (compact & faster) instead of keys for documents.
Goal: