diff options
author | Kamran Khan <kamran.khan@mongodb.com> | 2014-08-19 15:03:55 -0400 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2014-08-22 13:50:22 -0400 |
commit | c344f31ae584773c043abe3c718b4f7a151e4e28 (patch) | |
tree | 2ec082c027499383ae4fc12421fdddb181eef88e /jstests | |
parent | 5806dba8e1c2d2daf364ddc9f04d53fceaeb6022 (diff) | |
download | mongo-c344f31ae584773c043abe3c718b4f7a151e4e28.tar.gz |
SERVER-14738 Use language names instead of ISO codes in FTS tests
Closes #752
Signed-off-by: Benety Goh <benety@mongodb.com>
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/fts_index3.js | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/jstests/fts_index3.js b/jstests/fts_index3.js index 6b3648c1087..3b4517bcd1c 100644 --- a/jstests/fts_index3.js +++ b/jstests/fts_index3.js @@ -84,27 +84,27 @@ assert.eq(1, coll.runCommand("text", {search: "hello", filter: {b: 2}}).stats.n) coll.drop(); res = coll.ensureIndex({a: "text"}); assert.isnull(res); -coll.insert({a: "testing", language: "es"}); +coll.insert({a: "testing", language: "spanish"}); assert(!db.getLastError()); -assert.eq(1, coll.runCommand("text", {search: "testing", language: "es"}).stats.n); -assert.eq(0, coll.runCommand("text", {search: "testing", language: "en"}).stats.n); -coll.update({}, {$set: {language: "en"}}); +assert.eq(1, coll.runCommand("text", {search: "testing", language: "spanish"}).stats.n); +assert.eq(0, coll.runCommand("text", {search: "testing", language: "english"}).stats.n); +coll.update({}, {$set: {language: "english"}}); 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); +assert.eq(0, coll.runCommand("text", {search: "testing", language: "spanish"}).stats.n); +assert.eq(1, coll.runCommand("text", {search: "testing", language: "english"}).stats.n); // 8) Same as #7, but with a wildcard text index. coll.drop(); res = coll.ensureIndex({"$**": "text"}); assert.isnull(res); -coll.insert({a: "testing", language: "es"}); +coll.insert({a: "testing", language: "spanish"}); assert(!db.getLastError()); -assert.eq(1, coll.runCommand("text", {search: "testing", language: "es"}).stats.n); -assert.eq(0, coll.runCommand("text", {search: "testing", language: "en"}).stats.n); -coll.update({}, {$set: {language: "en"}}); +assert.eq(1, coll.runCommand("text", {search: "testing", language: "spanish"}).stats.n); +assert.eq(0, coll.runCommand("text", {search: "testing", language: "english"}).stats.n); +coll.update({}, {$set: {language: "english"}}); 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); +assert.eq(0, coll.runCommand("text", {search: "testing", language: "spanish"}).stats.n); +assert.eq(1, coll.runCommand("text", {search: "testing", language: "english"}).stats.n); // 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 @@ -112,24 +112,24 @@ assert.eq(1, coll.runCommand("text", {search: "testing", language: "en"}).stats. coll.drop(); res = coll.ensureIndex({a: "text"}, {language_override: "idioma"}); assert.isnull(res); -coll.insert({a: "testing", idioma: "es"}); +coll.insert({a: "testing", idioma: "spanish"}); assert(!db.getLastError()); -assert.eq(1, coll.runCommand("text", {search: "testing", language: "es"}).stats.n); -assert.eq(0, coll.runCommand("text", {search: "testing", language: "en"}).stats.n); -coll.update({}, {$set: {idioma: "en"}}); +assert.eq(1, coll.runCommand("text", {search: "testing", language: "spanish"}).stats.n); +assert.eq(0, coll.runCommand("text", {search: "testing", language: "english"}).stats.n); +coll.update({}, {$set: {idioma: "english"}}); 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); +assert.eq(0, coll.runCommand("text", {search: "testing", language: "spanish"}).stats.n); +assert.eq(1, coll.runCommand("text", {search: "testing", language: "english"}).stats.n); // 10) Same as #9, but with a wildcard text index. coll.drop(); res = coll.ensureIndex({"$**": "text"}, {language_override: "idioma"}); assert.isnull(res); -coll.insert({a: "testing", idioma: "es"}); +coll.insert({a: "testing", idioma: "spanish"}); assert(!db.getLastError()); -assert.eq(1, coll.runCommand("text", {search: "testing", language: "es"}).stats.n); -assert.eq(0, coll.runCommand("text", {search: "testing", language: "en"}).stats.n); -coll.update({}, {$set: {idioma: "en"}}); +assert.eq(1, coll.runCommand("text", {search: "testing", language: "spanish"}).stats.n); +assert.eq(0, coll.runCommand("text", {search: "testing", language: "english"}).stats.n); +coll.update({}, {$set: {idioma: "english"}}); 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); +assert.eq(0, coll.runCommand("text", {search: "testing", language: "spanish"}).stats.n); +assert.eq(1, coll.runCommand("text", {search: "testing", language: "english"}).stats.n); |