Sha256: de4f368971b8b6bf5f57914a84f3625908d4bcfa70816ed3a1525bef841ed4d5

Contents?: true

Size: 592 Bytes

Versions: 30

Compression:

Stored size: 592 Bytes

Contents

require "rsolr"
require "forwardable"

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

    module Methods
      extend Forwardable

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

      def solr
        RSolr.connect(ActiveFedora.solr_config)
      end

      def select(params, extra={})
        Response.new get("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

30 entries across 30 versions & 1 rubygems

Version Path
ddr-models-2.9.2 lib/ddr/index/connection.rb
ddr-models-2.9.1 lib/ddr/index/connection.rb
ddr-models-2.9.0 lib/ddr/index/connection.rb
ddr-models-2.9.0.rc1 lib/ddr/index/connection.rb
ddr-models-2.8.0 lib/ddr/index/connection.rb
ddr-models-2.8.0.rc1 lib/ddr/index/connection.rb
ddr-models-2.7.6 lib/ddr/index/connection.rb
ddr-models-2.7.5 lib/ddr/index/connection.rb
ddr-models-2.7.4 lib/ddr/index/connection.rb
ddr-models-2.7.3 lib/ddr/index/connection.rb
ddr-models-2.7.2 lib/ddr/index/connection.rb
ddr-models-2.7.1 lib/ddr/index/connection.rb
ddr-models-2.7.0 lib/ddr/index/connection.rb
ddr-models-2.7.0.rc1 lib/ddr/index/connection.rb
ddr-models-2.6.2 lib/ddr/index/connection.rb
ddr-models-2.6.1 lib/ddr/index/connection.rb
ddr-models-2.6.0 lib/ddr/index/connection.rb
ddr-models-2.6.0.rc4 lib/ddr/index/connection.rb
ddr-models-2.6.0.rc3 lib/ddr/index/connection.rb
ddr-models-2.6.0.rc2 lib/ddr/index/connection.rb