Skip to content
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_family): Add basic support for the FT.CONFIG command #4779

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

BagritsevichStepan
Copy link
Contributor

@BagritsevichStepan BagritsevichStepan commented Mar 16, 2025

fixes #4352

Add basic support of the MAXSEARCHRESULTS and MAXAGGREGATERESULTS options.

Issue with other options: #4780

@BagritsevichStepan BagritsevichStepan self-assigned this Mar 16, 2025
@BagritsevichStepan BagritsevichStepan marked this pull request as ready for review March 16, 2025 20:35
@BagritsevichStepan BagritsevichStepan changed the title feat(search_family): Add basic support for the FT.CONFIG feat(search_family): Add basic support for the FT.CONFIG command Mar 16, 2025
<< CI{"FT.ALTER", CO::WRITE | CO::GLOBAL_TRANS, -3, 0, 0, acl::FT_SEARCH}.HFUNC(FtAlter)
<< CI{"FT.DROPINDEX", CO::WRITE | CO::GLOBAL_TRANS, -2, 0, 0, acl::FT_SEARCH}.HFUNC(
FtDropIndex)
<< CI{"FT.CONFIG", CO::WRITE | CO::GLOBAL_TRANS, -3, 0, 0, acl::FT_SEARCH}.HFUNC(FtConfig)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also not sure what options should I set here, But I think since we are going to remove mutexes it sould be GLOBAL_TRANS

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be GLOBAL anycase

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you also need to add NO_KEY_TRANSACTIONAL

@BagritsevichStepan BagritsevichStepan force-pushed the search/add-basic-support-of-ft-config-command branch from fee09ba to 1d82c85 Compare March 19, 2025 13:09
@BagritsevichStepan BagritsevichStepan force-pushed the search/add-basic-support-of-ft-config-command branch from 1d82c85 to 1aabaed Compare March 19, 2025 13:22
DVLOG(2) << "Setting " << option << " to " << value;

auto cb = [option, value](util::ProactorBase*) { UpdateConfigOption(option, value); };
server_family_->service().proactor_pool().AwaitFiberOnAll(std::move(cb));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't meed server_family, you can use shard_set->pool()->AwaitFiberOnAll

@@ -24,8 +24,10 @@
#include "server/conn_context.h"
#include "server/container_utils.h"
#include "server/engine_shard_set.h"
#include "server/main_service.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you need it?

#include "server/search/aggregator.h"
#include "server/search/doc_index.h"
#include "server/server_family.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove

Comment on lines +1083 to +1098
void SearchFamily::FtConfigSet(CmdArgList args, const CommandContext& cmd_cntx) {
CmdArgParser parser{args};
auto* rb = static_cast<RedisReplyBuilder*>(cmd_cntx.rb);

string_view option = parser.Next();
uint64_t value = parser.Next<uint64_t>();

if (auto err = parser.Error(); err)
return rb->SendError(err->MakeReply());

auto option_exists = FindOptionsMapValue(kConfigOptions, option);
if (option_exists) {
DVLOG(2) << "Setting " << option << " to " << value;

auto cb = [option, value](util::ProactorBase*) { UpdateConfigOption(option, value); };
server_family_->service().proactor_pool().AwaitFiberOnAll(std::move(cb));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what will happen if we have 2 simultaneous commands?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for FT.CONFIG GET / SET
3 participants