调试:在mongodb全文搜索中查找词干词
如何在mongodb中查看词干词/搜索?我研究了增加loglevel和profiling,但没有看到实际搜索的单词stem 通过将loglevel设置为100后调试:在mongodb全文搜索中查找词干词,mongodb,mongodb-query,Mongodb,Mongodb Query,如何在mongodb中查看词干词/搜索?我研究了增加loglevel和profiling,但没有看到实际搜索的单词stem 通过将loglevel设置为100后 db.runCommand( { setParameter: 1, logLevel: 100 } ); 我得到了以下日志输出: command pwo81.$cmd command: count { count: "Pool0", query: { $text: { $search: "Basys" } }, fields: {}
db.runCommand( { setParameter: 1, logLevel: 100 } );
我得到了以下日志输出:
command pwo81.$cmd command: count { count: "Pool0", query: { $text: { $search: "Basys" } }, fields: {} } planSummary: TEXT { _fts: "text", _ftsx: 1 } keyUpdates:0 numYields:0 locks(micros) r:354 reslen:48 0ms
不使用count()而单独使用find()不会改变日志输出
使用的搜索查询是:
db.Pool0.find({$text: {$search: "Basys"}})
不幸的是,它产生的结果比预期的要多,尽管搜索“Basys”会显示正确的结果。使用详细信息:
> db.text.insert({ "statement" : "I'm not a clown!" })
> db.text.ensureIndex({ "statement" : "text" })
> db.text.find({ "$text" : { "$search" : "clowning" } }).explain(true)
{
"cursor" : "TextCursor",
...
"parsedTextQuery" : {
"terms" : [
"clown"
],
"negatedTerms" : [ ],
"phrases" : [ ],
"negatedPhrases" : [ ]
},
...
}