diff options
author | Jason Rassi <rassi@10gen.com> | 2013-10-10 08:17:55 -0700 |
---|---|---|
committer | Jason Rassi <rassi@10gen.com> | 2013-10-11 17:32:19 -0700 |
commit | a1d5f24d910d1407b8c166d99f0df99640845a2e (patch) | |
tree | 2ea28ba694acd84c8679976a57e53c4ce7566850 /jstests | |
parent | 08fde2e6a23a98d8ca1ef9593891f4de027d2474 (diff) | |
download | mongo-a1d5f24d910d1407b8c166d99f0df99640845a2e.tar.gz |
SERVER-9063 Add new plan stage TextStage
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/stages_text.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/jstests/stages_text.js b/jstests/stages_text.js new file mode 100644 index 00000000000..bcfeb07e6bd --- /dev/null +++ b/jstests/stages_text.js @@ -0,0 +1,19 @@ +// Test very basic functionality of text stage + +t = db.stages_text; +t.drop(); +t.save({x: "az b x"}) + +// Sets any params needed to make a text index. +load("jstests/libs/fts.js"); +t.ensureIndex({x: "text"}) + +// We expect to retrieve 'b' +res = db.runCommand({stageDebug: {text: {args: {name: "test.stages_text", search: "b"}}}}); +assert.eq(res.ok, 1); +assert.eq(res.results.length, 1); + +// I have not been indexed yet. +res = db.runCommand({stageDebug: {text: {args: {name: "test.stages_text", search: "hari"}}}}); +assert.eq(res.ok, 1); +assert.eq(res.results.length, 0); |