Sha256: ce0f6a2282e1b6bbde0b50848d68ea3dddde99d72f5b4f5f5c3d2ac8388bcfa5

Contents?: true

Size: 692 Bytes

Versions: 8

Compression:

Stored size: 692 Bytes

Contents

# frozen_string_literal: true
module Geoblacklight
  module Relation
    class Descendants
      def initialize(id, field, repository)
        @search_id = id
        @field = field
        @repository = repository
      end

      def create_search_params
        { fq: "#{@field}:#{@search_id}",
          fl: [Settings.FIELDS.TITLE, Settings.FIELDS.ID, Settings.FIELDS.RESOURCE_TYPE] }
      end

      def execute_query
        @repository.connection.send_and_receive(
          @repository.blacklight_config.solr_path,
          params: create_search_params
        )
      end

      def results
        response = execute_query
        response['response']
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
geoblacklight-4.0.0 lib/geoblacklight/relation/descendants.rb
geoblacklight-4.0.0.pre.rc3 lib/geoblacklight/relation/descendants.rb
geoblacklight-4.0.0.pre.rc2 lib/geoblacklight/relation/descendants.rb
geoblacklight-4.0.0.pre.rc1 lib/geoblacklight/relation/descendants.rb
geoblacklight-4.0.0.pre.alpha.3 lib/geoblacklight/relation/descendants.rb
geoblacklight-4.0.0.pre.alpha.2 lib/geoblacklight/relation/descendants.rb
geoblacklight-4.0.0.pre.alpha.1 lib/geoblacklight/relation/descendants.rb
geoblacklight-4.0.0.pre.alpha lib/geoblacklight/relation/descendants.rb