Sha256: b6f44a4d64333d252ff157e89fb8d8f23c38fd391f5f85f5ccb2a362039d17c7

Contents?: true

Size: 870 Bytes

Versions: 7

Compression:

Stored size: 870 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.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

7 entries across 7 versions & 2 rubygems

Version Path
sunspot-0.10.5 lib/sunspot/dsl/search.rb
sunspot-0.10.4 lib/sunspot/dsl/search.rb
kuahyeow-sunspot-0.10.3 lib/sunspot/dsl/search.rb
sunspot-0.10.3 lib/sunspot/dsl/search.rb
sunspot-0.10.2 lib/sunspot/dsl/search.rb
sunspot-0.10.1 lib/sunspot/dsl/search.rb
sunspot-0.10.0 lib/sunspot/dsl/search.rb