0
昨天我重新编制了我的收藏。它有超过200万份文件。Mongoid text_search花费时间过长
通过MongoDB的客户端(robomongo)我有一点时间结果搜索:
db.items.find({$text: {$search: "The Long Haul"}})
http://cl.ly/image/182B1P2D1h2n
然而,执行与Mongoid text_search搜索:
Item.text_search(term).execute
查询需要永远(超过2分钟)(通过text_search进行的其他搜索需要更少的时间)。
D, [2014-12-19T17:56:07.598777 #66067] DEBUG -- : MOPED: 22.22.22.22:43700 COMMAND database=production command={:text=>"items", :search=>"\"The\"\"Long\"\"Haul\""} runtime: 131198.9850ms
OVER
131.199424
是否text_search执行查询从“原始”文本搜索有什么不同?
谢谢。我转移到Elasticsearch(w/searchkick),但这回答了我的问题:) – borjagvo
我认为这是最接近全文搜索,你会得到:Item.where({:$ text => {:$ search =>“The长途”} } ) – Donato