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.6.0.rc1 lib/ddr/index/connection.rb
ddr-models-2.5.3 lib/ddr/index/connection.rb
ddr-models-2.5.2 lib/ddr/index/connection.rb
ddr-models-2.5.1 lib/ddr/index/connection.rb
ddr-models-2.5.0 lib/ddr/index/connection.rb
ddr-models-2.5.0.rc1 lib/ddr/index/connection.rb
ddr-models-2.4.16 lib/ddr/index/connection.rb
ddr-models-2.4.15 lib/ddr/index/connection.rb
ddr-models-2.4.14 lib/ddr/index/connection.rb
ddr-models-2.4.13 lib/ddr/index/connection.rb