Sha256: 4f9af0029b1bbed0dd6ccbedb79b3f0d810f31b3614811277f7ed2d493781da4

Contents?: true

Size: 892 Bytes

Versions: 15

Compression:

Stored size: 892 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::StandardQuery, Sunspot::DSL::FieldQuery,
    # and Sunspot::DSL::Scope for the full API presented.
    #
    class Search < StandardQuery
      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_accessor_for(Post).include = [:blog, :comments]
      #   end
      #
      def data_accessor_for(clazz)
        @search.data_accessor_for(clazz)
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
sunspot-2.7.1 lib/sunspot/dsl/search.rb
sunspot-2.7.0 lib/sunspot/dsl/search.rb
sunspot-2.6.0 lib/sunspot/dsl/search.rb
sunspot-2.5.0 lib/sunspot/dsl/search.rb
sunspot-2.4.0 lib/sunspot/dsl/search.rb
sunspot-2.3.0 lib/sunspot/dsl/search.rb
sunspot-2.2.8 lib/sunspot/dsl/search.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/sunspot-2.2.7/lib/sunspot/dsl/search.rb
sunspot-2.2.7 lib/sunspot/dsl/search.rb
sunspot-2.2.6 lib/sunspot/dsl/search.rb
sunspot-2.2.5 lib/sunspot/dsl/search.rb
sunspot-2.2.4 lib/sunspot/dsl/search.rb
sunspot-2.2.3 lib/sunspot/dsl/search.rb
sunspot-2.2.2 lib/sunspot/dsl/search.rb
sunspot-2.2.1 lib/sunspot/dsl/search.rb