Rails + Thinking-Sphinx result ids
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.se开发者_如何学Goarch('boby').map(&:id)
it makes a request to the database which is redundant.
You can call search_for_ids
method to return just the primary key values, instead of instances of ActiveRecord objects.
MyModel.search_for_ids 'body'
精彩评论