Sha256: 7e72ec35637300ed201115269d765ca80538b2daa628abc6bcf80d5b719037b4

Contents?: true

Size: 878 Bytes

Versions: 11

Compression:

Stored size: 878 Bytes

Contents

module Sunspot
  module DSL
    # 
    # This top-level DSL class is the context in which the block passed to
    # Sunspot.query. See Sunspot::DSL::Query, Sunspot::DSL::FieldQuery, and
    # Sunspot::DSL::Scope for the full API presented.
    #
    class Search < Query
      def initialize(search, setup) #:nodoc:
        @search = search
        super(search, search.query, setup)
      end

      # 
      # 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_acccessor_for(Post).includes = [:blog, :comments]
      #   end
      #
      def data_accessor_for(clazz)
        @search.data_accessor_for(clazz)
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
sunspot-1.0.5 lib/sunspot/dsl/search.rb
sunspot-1.0.4 lib/sunspot/dsl/search.rb
sunspot-1.0.3 lib/sunspot/dsl/search.rb
sunspot-1.0.2 lib/sunspot/dsl/search.rb
sunspot-1.0.1 lib/sunspot/dsl/search.rb
sunspot-1.0.0 lib/sunspot/dsl/search.rb
sunspot-0.10.9 lib/sunspot/dsl/search.rb
sunspot-0.10.8 lib/sunspot/dsl/search.rb
nxa-sunspot-0.10.7 lib/sunspot/dsl/search.rb
sunspot-0.10.7 lib/sunspot/dsl/search.rb
sunspot-0.10.6 lib/sunspot/dsl/search.rb