Sha256: f2f94980b6fd8b42168110ae44eb1bae4e0674a2ee9f5cfe94593548e81fffa6

Contents?: true

Size: 677 Bytes

Versions: 15

Compression:

Stored size: 677 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
        # Changed for Valkyrie
        # RSolr.connect(ActiveFedora.solr_config)
        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

15 entries across 15 versions & 1 rubygems

Version Path
ddr-core-1.4.3 lib/ddr/index/connection.rb
ddr-core-1.4.2 lib/ddr/index/connection.rb
ddr-core-1.4.0 lib/ddr/index/connection.rb
ddr-core-1.3.0 lib/ddr/index/connection.rb
ddr-core-1.2.0 lib/ddr/index/connection.rb
ddr-core-1.2.0.rc3 lib/ddr/index/connection.rb
ddr-core-1.2.0.rc2 lib/ddr/index/connection.rb
ddr-core-1.2.0.rc1 lib/ddr/index/connection.rb
ddr-core-1.1.2 lib/ddr/index/connection.rb
ddr-core-1.1.1 lib/ddr/index/connection.rb
ddr-core-1.1.0 lib/ddr/index/connection.rb
ddr-core-1.0.0 lib/ddr/index/connection.rb
ddr-core-0.3.0 lib/ddr/index/connection.rb
ddr-core-0.2.2 lib/ddr/index/connection.rb
ddr-core-0.2.1 lib/ddr/index/connection.rb