class Sunspot::DSL::Search
This top-level DSL
class is the context in which the block passed to Sunspot.query. See Sunspot::DSL::StandardQuery
, Sunspot::DSL::FieldQuery
, and Sunspot::DSL::Scope
for the full API presented.
Public Instance Methods
data_accessor_for(clazz)
click to toggle source
Retrieve the data accessor used to load instances of the given class out of persistent storage. Data accessors are free to implement any extra methods that may be useful in this context.
Example¶ ↑
Sunspot.search Post do data_accessor_for(Post).include = [:blog, :comments] end
# File lib/sunspot/dsl/search.rb, line 25 def data_accessor_for(clazz) @search.data_accessor_for(clazz) end