db.data.aggregate({ "$match" : { "$text" : { "$search" : "<text here>" } } },
{"$match" : {"doc_type": "PATENT"} },
{ "$group" :
{ "_id" :{"doc_type": "$doc_type" ,"title" : "$title", "player_name" : "$player_name", "player_type" : "INSTITUTION", "country_code" :"$country_code" },
"number_records" : { "$sum" : 1}
}
},
{"$sort":{"number_records" : -1}},
{"$limit" : 10}
我正在尝试执行上述文本搜索聚合,但是此查询的执行速度非常慢,或者对于某些文本查询,它只会保持加载状态。我有什么错误吗?