Sha256: b5a63195a1ed83e9216fbc2d4ae2586717ebcb165673d32edd52b36799c54b94

Contents?: true

Size: 596 Bytes

Versions: 28

Compression:

Stored size: 596 Bytes

Contents

require "rsolr"
require "forwardable"

module Ddr::Index
  #
  # Wraps an RSolr connection
  #
  class Connection

    module Methods
      extend Forwardable

      delegate [:get, :post, :paginate] => :solr

      def solr
        Blacklight.default_index.connection
      end

      def select(params, extra={})
        Response.new post("select", params: params.merge(extra))
      end

      def page(*args)
        Response.new paginate(*args)
      end

      def count(params)
        select(params, rows: 0).num_found
      end
    end

    extend Methods
    include Methods

  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
ddr-core-1.17.0 lib/ddr/index/connection.rb
ddr-core-1.16.0 lib/ddr/index/connection.rb
ddr-core-1.15.0 lib/ddr/index/connection.rb
ddr-core-1.14.0 lib/ddr/index/connection.rb
ddr-core-1.13.2 lib/ddr/index/connection.rb
ddr-core-1.13.1 lib/ddr/index/connection.rb
ddr-core-1.13.0 lib/ddr/index/connection.rb
ddr-core-1.12.2 lib/ddr/index/connection.rb
ddr-core-1.12.1 lib/ddr/index/connection.rb
ddr-core-1.12.0 lib/ddr/index/connection.rb
ddr-core-1.11.0 lib/ddr/index/connection.rb
ddr-core-1.10.0 lib/ddr/index/connection.rb
ddr-core-1.9.0 lib/ddr/index/connection.rb
ddr-core-1.8.0 lib/ddr/index/connection.rb
ddr-core-1.7.0 lib/ddr/index/connection.rb
ddr-core-1.6.6 lib/ddr/index/connection.rb
ddr-core-1.6.5 lib/ddr/index/connection.rb
ddr-core-1.6.4 lib/ddr/index/connection.rb
ddr-core-1.6.3 lib/ddr/index/connection.rb
ddr-core-1.6.2 lib/ddr/index/connection.rb