Sha256: 4406eedf836626689213bdbd1e89980a9d5969a0d6a97a3df5b06fc9a8d34e8e

Contents?: true

Size: 555 Bytes

Versions: 3

Compression:

Stored size: 555 Bytes

Contents

# frozen_string_literal: true

module Hyrax
  ##
  # Indexes properties common to Hyrax::Resource types
  module LocationIndexer
    def to_solr
      super.tap do |index_document|
        index_document[:based_near_label_tesim] = based_near_label_lookup(resource.based_near) if resource.respond_to? :based_near
      end
    end

    private

    def based_near_label_lookup(locations)
      locations.map do |loc|
        location_service.full_label(loc)
      end
    end

    def location_service
      Hyrax.config.location_service
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hyrax-5.0.1 app/indexers/concerns/hyrax/location_indexer.rb
hyrax-5.0.0 app/indexers/concerns/hyrax/location_indexer.rb
hyrax-5.0.0.rc3 app/indexers/concerns/hyrax/location_indexer.rb