It might be helpful if you specified exactly what information you're looking for from text search, but there is a way to see what the terms in a text query were with verbose explain:
> db.test.drop()
> db.test.insert({ "t" : "The quick brown fox jumps over the lazy dog" })
> db.test.ensureIndex({ "t" : "text" })
> db.test.count({ "$text" : { "$search" : "jumping quickly" } })
1
> db.test.find({ "$text" : { "$search" : "jumping quickly" } }).explain(true)
{
"cursor" : "TextCursor",
"n" : 1,
"nscannedObjects" : 1,
"nscanned" : 2,
"nscannedObjectsAllPlans" : 1,
"nscannedAllPlans" : 2,
"scanAndOrder" : false,
"nYields" : 0,
"nChunkSkips" : 0,
"millis" : 0,
"allPlans" : [
{
"cursor" : "TextCursor",
"n" : 1,
"nscannedObjects" : 1,
"nscanned" : 2,
"scanAndOrder" : false,
"nChunkSkips" : 0
}
],
"server" : "luna.local:27017",
"filterSet" : false,
"stats" : {
"type" : "TEXT",
"works" : 7,
"yields" : 0,
"unyields" : 0,
"invalidates" : 0,
"advanced" : 1,
"needTime" : 5,
"needFetch" : 0,
"isEOF" : 1,
"keysExamined" : 2,
"fetches" : 1,
"parsedTextQuery" : {
"terms" : [
"jump",
"quick"
],
"negatedTerms" : [ ],
"phrases" : [ ],
"negatedPhrases" : [ ]
},
"children" : [ ]
}
}
I don't think there's a way to see the stats on term frequencies for a query or for text indexed fields as of MongoDB 2.6.
댓글 없음:
댓글 쓰기