diff options
author | David Storch <david.storch@10gen.com> | 2016-02-23 12:59:07 -0500 |
---|---|---|
committer | David Storch <david.storch@10gen.com> | 2016-02-25 16:29:26 -0500 |
commit | fe34b917cddb70f5a38ab199194f891eb9286925 (patch) | |
tree | 3b81844cd2c7c5d2b7f96912b917de59464e037f /src/mongo/db/fts | |
parent | dac2b0d7269341c6033170aef76352bba2663422 (diff) | |
download | mongo-fe34b917cddb70f5a38ab199194f891eb9286925.tar.gz |
SERVER-13026 clarify error message for invalid text index weights
Diffstat (limited to 'src/mongo/db/fts')
-rw-r--r-- | src/mongo/db/fts/fts_spec.cpp | 5 | ||||
-rw-r--r-- | src/mongo/db/fts/fts_spec_legacy.cpp | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/mongo/db/fts/fts_spec.cpp b/src/mongo/db/fts/fts_spec.cpp index f825cce4ce7..9a5a4f78bc6 100644 --- a/src/mongo/db/fts/fts_spec.cpp +++ b/src/mongo/db/fts/fts_spec.cpp @@ -364,7 +364,10 @@ BSONObj FTSSpec::fixSpec(const BSONObj& spec) { { BSONObjBuilder b; for (map<string, int>::iterator i = m.begin(); i != m.end(); ++i) { - uassert(16674, "score for word too high", i->second > 0 && i->second < MAX_WORD_WEIGHT); + uassert(16674, + str::stream() << "text index weight must be in the exclusive interval (0," + << MAX_WORD_WEIGHT << ") but found: " << i->second, + i->second > 0 && i->second < MAX_WORD_WEIGHT); // Verify weight refers to a valid field. if (i->first != "$**") { diff --git a/src/mongo/db/fts/fts_spec_legacy.cpp b/src/mongo/db/fts/fts_spec_legacy.cpp index 4a161c8614a..8d36b51ca61 100644 --- a/src/mongo/db/fts/fts_spec_legacy.cpp +++ b/src/mongo/db/fts/fts_spec_legacy.cpp @@ -238,7 +238,10 @@ BSONObj FTSSpec::_fixSpecV1(const BSONObj& spec) { { BSONObjBuilder b; for (map<string, int>::iterator i = m.begin(); i != m.end(); ++i) { - uassert(17365, "score for word too high", i->second > 0 && i->second < MAX_WORD_WEIGHT); + uassert(17365, + str::stream() << "text index weight must be in the exclusive interval (0," + << MAX_WORD_WEIGHT << ") but found: " << i->second, + i->second > 0 && i->second < MAX_WORD_WEIGHT); b.append(i->first, i->second); } weights = b.obj(); |