diff options
author | David Storch <david.storch@10gen.com> | 2017-09-27 16:29:32 -0400 |
---|---|---|
committer | David Storch <david.storch@10gen.com> | 2017-09-29 08:07:02 -0400 |
commit | 026b5f6f38c883c48d063ac8ee736f7330227281 (patch) | |
tree | f29b891ce5e453eaa52f3289429f92789a5c9572 /jstests | |
parent | 65c82b5017d37aeef9fb0075543424873f1197ad (diff) | |
download | mongo-026b5f6f38c883c48d063ac8ee736f7330227281.tar.gz |
SERVER-31139 Fix invariant failure caused by text index plan enumeration bug.
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/core/fts_dotted_prefix_fields.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/jstests/core/fts_dotted_prefix_fields.js b/jstests/core/fts_dotted_prefix_fields.js new file mode 100644 index 00000000000..f811c4a7203 --- /dev/null +++ b/jstests/core/fts_dotted_prefix_fields.js @@ -0,0 +1,15 @@ +// Test that text search works correct when the text index has dotted paths as the non-text +// prefixes. +(function() { + "use strict"; + + let coll = db.fts_dotted_prefix_fields; + coll.drop(); + assert.commandWorked(coll.createIndex({"a.x": 1, "a.y": 1, "b.x": 1, "b.y": 1, words: "text"})); + assert.writeOK(coll.insert({a: {x: 1, y: 2}, b: {x: 3, y: 4}, words: "lorem ipsum dolor sit"})); + assert.writeOK(coll.insert({a: {x: 1, y: 2}, b: {x: 5, y: 4}, words: "lorem ipsum dolor sit"})); + + assert.eq(1, + coll.find({$text: {$search: "lorem ipsum"}, "a.x": 1, "a.y": 2, "b.x": 3, "b.y": 4}) + .itcount()); +}()); |