Sha256: 397e6cbe7cde5dbb86527ec7718f0f74184390429501f3672396ccc65890eec7

Contents?: true

Size: 585 Bytes

Versions: 12

Compression:

Stored size: 585 Bytes

Contents

# frozen_string_literal: true
class Blacklight::Solr::Response::Group

  include Blacklight::Solr::Response::PaginationMethods

  attr_reader :key, :group, :response
  
  def initialize key, group, response
    @key = key
    @group = group
    @response = response
  end

  def doclist
    group[:doclist]
  end

  # short cut to response['numFound']
  def total
    doclist[:numFound].to_s.to_i
  end
    
  def start
    doclist[:start].to_s.to_i
  end

  def docs
    doclist[:docs].map {|doc| SolrDocument.new(doc, response)}
  end

  def field
    response.group_field
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
blacklight-6.5.0 lib/blacklight/solr/response/group.rb
blacklight-6.4.2 lib/blacklight/solr/response/group.rb
blacklight-6.4.1 lib/blacklight/solr/response/group.rb
blacklight-6.4.0 lib/blacklight/solr/response/group.rb
blacklight-6.3.3 lib/blacklight/solr/response/group.rb
blacklight-6.3.1 lib/blacklight/solr/response/group.rb
blacklight-6.3.0 lib/blacklight/solr/response/group.rb
blacklight-6.2.0 lib/blacklight/solr/response/group.rb
blacklight-6.1.0 lib/blacklight/solr/response/group.rb
blacklight-6.0.2 lib/blacklight/solr/response/group.rb
blacklight-6.0.1 lib/blacklight/solr/response/group.rb
blacklight-6.0.0 lib/blacklight/solr/response/group.rb