summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2015-10-08 11:04:16 -0400
committerMark Benvenuto <mark.benvenuto@mongodb.com>2015-10-15 14:47:14 -0400
commit20e2bf0b7c57268877b8ab23ad29b3f57af624ff (patch)
tree32f3da579c49baac89220b608d192da28ea3697a /jstests
parent6adf88a277d5e761aaed28a3f522768b3f4f6143 (diff)
downloadmongo-20e2bf0b7c57268877b8ab23ad29b3f57af624ff.tar.gz
SERVER-19906: verify() failure when text index on "_fts" has weights set to empty object
Diffstat (limited to 'jstests')
-rw-r--r--jstests/core/fts_index.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/jstests/core/fts_index.js b/jstests/core/fts_index.js
index b3ba522d74b..d5e5867a182 100644
--- a/jstests/core/fts_index.js
+++ b/jstests/core/fts_index.js
@@ -3,6 +3,7 @@
// 2. Text indexes properly enforce a schema on the language_override field.
// 3. Collections may have at most one text index.
// 4. Text indexes properly handle large documents.
+// 5. Bad weights test cases.
var coll = db.fts_index;
var indexName = "textIndex";
@@ -140,5 +141,13 @@ for(var i = 0; i < 1024 * 1024; ++i) {
coll.insert({a: longstring});
coll.insert({a: longstring2});
assert.eq(1, coll.find({$text: {$search: longstring}}).itcount(), "long string not found in index");
+coll.dropIndexes();
+
+//
+// 5. Bad weights test cases.
+//
+assert.commandFailed(coll.ensureIndex({a: 1, _fts: "text", _ftsx: 1, c: 1}, {weights: {}}));
+assert.commandFailed(coll.ensureIndex({a: 1, _fts: "text", _ftsx: 1, c: 1}));
+
coll.drop();