diff options
Diffstat (limited to 'src/mongo/db/fts/fts_spec.cpp')
-rw-r--r-- | src/mongo/db/fts/fts_spec.cpp | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/mongo/db/fts/fts_spec.cpp b/src/mongo/db/fts/fts_spec.cpp index 20560ccdad5..c358ba4b679 100644 --- a/src/mongo/db/fts/fts_spec.cpp +++ b/src/mongo/db/fts/fts_spec.cpp @@ -59,9 +59,9 @@ const std::string moduleDefaultLanguage("english"); bool validateOverride(const string& override) { // The override field can't be empty, can't be prefixed with a dollar sign, and // can't contain a dot. - return !override.empty()&& override[0] != '$' && override.find('.') == std::string::npos; -} + return !override.empty() && override[0] != '$' && override.find('.') == std::string::npos; } +} // namespace FTSSpec::FTSSpec(const BSONObj& indexInfo) { // indexInfo is a text index spec. Text index specs pass through fixSpec() before being @@ -90,12 +90,8 @@ FTSSpec::FTSSpec(const BSONObj& indexInfo) { msgasserted(17364, str::stream() << "attempt to use unsupported textIndexVersion " << textIndexVersionElt.numberInt() - << "; versions supported: " - << TEXT_INDEX_VERSION_3 - << ", " - << TEXT_INDEX_VERSION_2 - << ", " - << TEXT_INDEX_VERSION_1); + << "; versions supported: " << TEXT_INDEX_VERSION_3 << ", " + << TEXT_INDEX_VERSION_2 << ", " << TEXT_INDEX_VERSION_1); } // Initialize _defaultLanguage. Note that the FTSLanguage constructor requires @@ -272,7 +268,7 @@ Status verifyFieldNameNotReserved(StringData s) { return Status::OK(); } -} +} // namespace StatusWith<BSONObj> FTSSpec::fixSpec(const BSONObj& spec) { if (spec["textIndexVersion"].numberInt() == TEXT_INDEX_VERSION_1) { @@ -406,9 +402,7 @@ StatusWith<BSONObj> FTSSpec::fixSpec(const BSONObj& spec) { if (i->second <= 0 || i->second >= MAX_WORD_WEIGHT) { return {ErrorCodes::CannotCreateIndex, str::stream() << "text index weight must be in the exclusive interval (0," - << MAX_WORD_WEIGHT - << ") but found: " - << i->second}; + << MAX_WORD_WEIGHT << ") but found: " << i->second}; } // Verify weight refers to a valid field. @@ -513,5 +507,5 @@ StatusWith<BSONObj> FTSSpec::fixSpec(const BSONObj& spec) { return b.obj(); } -} -} +} // namespace fts +} // namespace mongo |