diff options
author | Jason Rassi <rassi@10gen.com> | 2014-08-13 19:23:51 -0400 |
---|---|---|
committer | Jason Rassi <rassi@10gen.com> | 2014-08-13 19:23:55 -0400 |
commit | bd14042812b9bab796a83672f95b2d0e2e6b4252 (patch) | |
tree | 620aa734d5c58ea5cff64cce2576f72c8ff3011c | |
parent | 91e1ec144205e140272b2ed9560accf634c4e93b (diff) | |
download | mongo-bd14042812b9bab796a83672f95b2d0e2e6b4252.tar.gz |
SERVER-14833 fts_index3.js build correct index, minor comment fixes
-rw-r--r-- | jstests/fts_index3.js | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/jstests/fts_index3.js b/jstests/fts_index3.js index 7fe4726d3c4..6b3648c1087 100644 --- a/jstests/fts_index3.js +++ b/jstests/fts_index3.js @@ -4,7 +4,7 @@ var coll = db.fts_index3; var res; // 1) Create a text index on a single field, insert a document, update the value of the field, and -// verify that $text with the new value returns the document. +// verify that searching with the new value returns the document. coll.drop(); res = coll.ensureIndex({a: "text"}); assert.isnull(res); @@ -18,7 +18,7 @@ assert.eq(1, coll.runCommand("text", {search: "world"}).stats.n); // 2) Same as #1, but with a wildcard text index. coll.drop(); -res = coll.ensureIndex({a: "text"}); +res = coll.ensureIndex({"$**": "text"}); assert.isnull(res); coll.insert({a: "hello"}); assert(!db.getLastError()); @@ -29,7 +29,7 @@ assert.eq(0, coll.runCommand("text", {search: "hello"}).stats.n); assert.eq(1, coll.runCommand("text", {search: "world"}).stats.n); // 3) Create a compound text index with an index prefix, insert a document, update the value of the -// index prefix field, and verify that $text with the new value returns the document. +// index prefix field, and verify that searching with the new value returns the document. coll.drop(); res = coll.ensureIndex({a: 1, b: "text"}); assert.isnull(res); @@ -54,7 +54,7 @@ assert.eq(0, coll.runCommand("text", {search: "hello", filter: {a: 1}}).stats.n) assert.eq(1, coll.runCommand("text", {search: "hello", filter: {a: 2}}).stats.n); // 5) Create a compound text index with an index suffix, insert a document, update the value of the -// index suffix field, and verify that $text with the new value returns the document. +// index suffix field, and verify that searching with the new value returns the document. coll.drop(); res = coll.ensureIndex({a: "text", b: 1}); assert.isnull(res); @@ -79,7 +79,8 @@ assert.eq(0, coll.runCommand("text", {search: "hello", filter: {b: 1}}).stats.n) assert.eq(1, coll.runCommand("text", {search: "hello", filter: {b: 2}}).stats.n); // 7) Create a text index on a single field, insert a document, update the language of the document -// (so as to change the stemming), and verify that $text with the new language returns the document. +// (so as to change the stemming), and verify that searching with the new language returns the +// document. coll.drop(); res = coll.ensureIndex({a: "text"}); assert.isnull(res); @@ -105,9 +106,9 @@ assert(!db.getLastError()); assert.eq(0, coll.runCommand("text", {search: "testing", language: "es"}).stats.n); assert.eq(1, coll.runCommand("text", {search: "testing", language: "en"}).stats.n); -// 10) Create a text index on a single field with a custom language override, insert a document, -// update the language of the document (so as to change the stemming), and verify that $text with -// the new language returns the document. +// 9) Create a text index on a single field with a custom language override, insert a document, +// update the language of the document (so as to change the stemming), and verify that searching +// with the new language returns the document. coll.drop(); res = coll.ensureIndex({a: "text"}, {language_override: "idioma"}); assert.isnull(res); @@ -120,7 +121,7 @@ assert(!db.getLastError()); assert.eq(0, coll.runCommand("text", {search: "testing", language: "es"}).stats.n); assert.eq(1, coll.runCommand("text", {search: "testing", language: "en"}).stats.n); -// 11) Same as #10, but with a wildcard text index. +// 10) Same as #9, but with a wildcard text index. coll.drop(); res = coll.ensureIndex({"$**": "text"}, {language_override: "idioma"}); assert.isnull(res); |