diff options
author | Adam Chelminski <adam.chelminski@mongodb.com> | 2015-07-29 15:05:21 -0400 |
---|---|---|
committer | Adam Chelminski <adam.chelminski@mongodb.com> | 2015-08-11 16:56:55 -0400 |
commit | 92eac3b57d8beaf063fced8839cd870f97826bb7 (patch) | |
tree | 0db84953876345d4725576538c14783cb81391e9 /jstests/core/fts_diacritic_and_caseinsensitive.js | |
parent | 657343ccff986bd2f8c46fc7455db4238e8801d1 (diff) | |
download | mongo-92eac3b57d8beaf063fced8839cd870f97826bb7.tar.gz |
SERVER-19557 Add text index v3
Diffstat (limited to 'jstests/core/fts_diacritic_and_caseinsensitive.js')
-rw-r--r-- | jstests/core/fts_diacritic_and_caseinsensitive.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/jstests/core/fts_diacritic_and_caseinsensitive.js b/jstests/core/fts_diacritic_and_caseinsensitive.js new file mode 100644 index 00000000000..7a65a56e2fc --- /dev/null +++ b/jstests/core/fts_diacritic_and_caseinsensitive.js @@ -0,0 +1,34 @@ +// Integration tests for no case or diacritic options to $text query operator. + +load('jstests/libs/fts.js'); + +(function() { + "use strict"; + var coll = db.fts_diacritic_and_caseinsensitive; + + coll.drop(); + + assert.writeOK(coll.insert({ + _id: 0, + a: "O próximo Vôo à Noite sobre o Atlântico, Põe Freqüentemente o único Médico." + })); + + assert.commandWorked(coll.ensureIndex({a: "text"}, {default_language: "portuguese"})); + + assert.eq([0], queryIDS(coll, "proximo voo a", null)); + assert.eq([0], queryIDS(coll, "átlántico", null)); + assert.eq([0], queryIDS(coll, "\"proxIMO\"", null)); + assert.eq([0], queryIDS(coll, "\"poé\" atlânTico", null)); + assert.eq([0], queryIDS(coll, "\"próximo voo\" \"unico médico\"", null)); + assert.eq([0], queryIDS(coll, "\"proximo voo\" -\"unico atlantico\"", null)); + + assert.eq([], queryIDS(coll, "À", null)); + assert.eq([], queryIDS(coll, "próximoo", null)); + assert.eq([], queryIDS(coll, "proximoo vvôo àa", null)); + assert.eq([], queryIDS(coll, "À -próximo -Vôo", null)); + assert.eq([], queryIDS(coll, "à proximo -voo", null)); + assert.eq([], queryIDS(coll, "mo vo", null)); + assert.eq([], queryIDS(coll, "\"unico atlantico\"", null)); + assert.eq([], queryIDS(coll, "\"próximo Vôo\" -\"unico medico\"", null)); + +})(); |