diff --git a/src/flags/run_time_configurable.cpp b/src/flags/run_time_configurable.cpp index a42ebd3d0..e54b7f596 100644 --- a/src/flags/run_time_configurable.cpp +++ b/src/flags/run_time_configurable.cpp @@ -1,4 +1,4 @@ -// Copyright 2023 Memgraph Ltd. +// Copyright 2024 Memgraph Ltd. // // Use of this software is governed by the Business Source License // included in the file licenses/BSL.txt; by using this file, you agree to be bound by the terms of the Business Source @@ -73,11 +73,15 @@ constexpr auto kLogToStderrGFlagsKey = "also_log_to_stderr"; constexpr auto kCartesianProductEnabledSettingKey = "cartesian-product-enabled"; constexpr auto kCartesianProductEnabledGFlagsKey = "cartesian-product-enabled"; -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -std::atomic execution_timeout_sec_; // Local cache-like thing +constexpr auto kTextSearchEnabledSettingKey = "text-search-enabled"; +constexpr auto kTextSearchEnabledGFlagsKey = "text-search-enabled"; -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -std::atomic cartesian_product_enabled_{true}; // Local cache-like thing +// NOLINTBEGIN(cppcoreguidelines-avoid-non-const-global-variables) +// Local cache-like thing +std::atomic execution_timeout_sec_; +std::atomic cartesian_product_enabled_{true}; +std::atomic text_search_enabled_{true}; +// NOLINTEND(cppcoreguidelines-avoid-non-const-global-variables) auto ToLLEnum(std::string_view val) { const auto ll_enum = memgraph::flags::LogLevelToEnum(val); @@ -186,6 +190,10 @@ void Initialize() { register_flag( kCartesianProductEnabledGFlagsKey, kCartesianProductEnabledSettingKey, !kRestore, [](const std::string &val) { cartesian_product_enabled_ = val == "true"; }, ValidBoolStr); + + register_flag( + kTextSearchEnabledGFlagsKey, kTextSearchEnabledSettingKey, !kRestore, + [](const std::string &val) { text_search_enabled_ = val == "true"; }, ValidBoolStr); } std::string GetServerName() { @@ -199,4 +207,6 @@ double GetExecutionTimeout() { return execution_timeout_sec_; } bool GetCartesianProductEnabled() { return cartesian_product_enabled_; } +bool GetTextSearchEnabled() { return text_search_enabled_; } + } // namespace memgraph::flags::run_time diff --git a/src/flags/run_time_configurable.hpp b/src/flags/run_time_configurable.hpp index 944a0539f..a06437100 100644 --- a/src/flags/run_time_configurable.hpp +++ b/src/flags/run_time_configurable.hpp @@ -1,4 +1,4 @@ -// Copyright 2023 Memgraph Ltd. +// Copyright 2024 Memgraph Ltd. // // Use of this software is governed by the Business Source License // included in the file licenses/BSL.txt; by using this file, you agree to be bound by the terms of the Business Source @@ -42,4 +42,11 @@ double GetExecutionTimeout(); */ bool GetCartesianProductEnabled(); +/** + * @brief Get whether text search is enabled + * + * @return bool + */ +bool GetTextSearchEnabled(); + } // namespace memgraph::flags::run_time