Hey. I use Rails 3.0.1 with thinking-sphinx.
How can I get a list of IDs from a sphinx request? If I do
MyModel.search('boby').map(&:id)
it makes a request to the database which is redundant.
您可以调用search_for_ids
方法以仅返回主键值,而不是ActiveRecord对象的实例。
MyModel.search_for_ids 'body'
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.