diff options
Diffstat (limited to 'jstests/core/fts_explain.js')
-rw-r--r-- | jstests/core/fts_explain.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/jstests/core/fts_explain.js b/jstests/core/fts_explain.js new file mode 100644 index 00000000000..0d9c1fd7a9d --- /dev/null +++ b/jstests/core/fts_explain.js @@ -0,0 +1,18 @@ +// Test $text explain. SERVER-12037. + +var coll = db.fts_explain; + +coll.drop(); +coll.ensureIndex({content: "text"}, {default_language: "none"}); +assert.gleSuccess(db); + +coll.insert({content: "some data"}); +assert.gleSuccess(db); + +var explain = coll.find({$text:{$search: "\"a\" -b -\"c\""}}).explain(true); +assert.eq(explain.cursor, "TextCursor"); +assert.eq(explain.stats.type, "TEXT"); +assert.eq(explain.stats.parsedTextQuery.terms, ["a"]); +assert.eq(explain.stats.parsedTextQuery.negatedTerms, ["b"]); +assert.eq(explain.stats.parsedTextQuery.phrases, ["a"]); +assert.eq(explain.stats.parsedTextQuery.negatedPhrases, ["c"]); |