diff options
Diffstat (limited to 'src/mongo/db/fts/fts_enabled.cpp')
-rw-r--r-- | src/mongo/db/fts/fts_enabled.cpp | 68 |
1 files changed, 32 insertions, 36 deletions
diff --git a/src/mongo/db/fts/fts_enabled.cpp b/src/mongo/db/fts/fts_enabled.cpp index b8e071bd62a..fb261194db1 100644 --- a/src/mongo/db/fts/fts_enabled.cpp +++ b/src/mongo/db/fts/fts_enabled.cpp @@ -35,46 +35,42 @@ #include "mongo/util/log.h" namespace mongo { - namespace fts { - namespace { +namespace fts { +namespace { - bool dummyEnabledFlag = true; // Unused, needed for server parameter. +bool dummyEnabledFlag = true; // Unused, needed for server parameter. - /** - * Declaration for the "textSearchEnabled" server parameter, which is now deprecated. - * Note that: - * - setting to true performs a no-op and logs a deprecation message. - * - setting to false will fail. - */ - class ExportedTextSearchEnabledParameter : public ExportedServerParameter<bool> { - public: - ExportedTextSearchEnabledParameter() : - ExportedServerParameter<bool>( ServerParameterSet::getGlobal(), - "textSearchEnabled", - &dummyEnabledFlag, - true, - true ) {} - - virtual Status validate( const bool& potentialNewValue ) { - if ( !potentialNewValue ) { - return Status( ErrorCodes::BadValue, - "textSearchEnabled cannot be set to false"); - } - - log() << "Attempted to set textSearchEnabled server parameter."; - log() << "Text search is enabled by default and cannot be disabled."; - log() << "The following are now deprecated and will be removed in a future " - << "release:"; - log() << "- the \"textSearchEnabled\" server parameter (setting it has no " - << "effect)"; - log() << "- the \"text\" command (has been replaced by the $text query " - "operator)"; +/** + * Declaration for the "textSearchEnabled" server parameter, which is now deprecated. + * Note that: + * - setting to true performs a no-op and logs a deprecation message. + * - setting to false will fail. + */ +class ExportedTextSearchEnabledParameter : public ExportedServerParameter<bool> { +public: + ExportedTextSearchEnabledParameter() + : ExportedServerParameter<bool>( + ServerParameterSet::getGlobal(), "textSearchEnabled", &dummyEnabledFlag, true, true) { + } - return Status::OK(); - } + virtual Status validate(const bool& potentialNewValue) { + if (!potentialNewValue) { + return Status(ErrorCodes::BadValue, "textSearchEnabled cannot be set to false"); + } - } exportedTextSearchEnabledParam; + log() << "Attempted to set textSearchEnabled server parameter."; + log() << "Text search is enabled by default and cannot be disabled."; + log() << "The following are now deprecated and will be removed in a future " + << "release:"; + log() << "- the \"textSearchEnabled\" server parameter (setting it has no " + << "effect)"; + log() << "- the \"text\" command (has been replaced by the $text query " + "operator)"; - } + return Status::OK(); } + +} exportedTextSearchEnabledParam; +} +} } |