Sha256: 5028e907732e84ffb8f51d37a6e0256fb36c3c3d81bb6f5ee7ed418b923d7be5

Contents?: true

Size: 736 Bytes

Versions: 2

Compression:

Stored size: 736 Bytes

Contents

module Geoblacklight
  module ControllerOverride
    extend ActiveSupport::Concern
    included do
      solr_search_params_logic << :add_spatial_params
    end

    def add_spatial_params(solr_params, req_params)
      if req_params[:bbox]
        solr_params[:bq] ||= []
        solr_params[:bq] = ["#{Settings.GEOMETRY_FIELD}:\"IsWithin(#{req_params[:bbox]})\"^10"]
        solr_params[:fq] ||= []
        solr_params[:fq] << "#{Settings.GEOMETRY_FIELD}:\"Intersects(#{req_params[:bbox]})\""
      end
      solr_params
    end

    def web_services
      @response, @document = get_solr_response_for_doc_id params[:id]
    end

    def metadata
      @response, @document = get_solr_response_for_doc_id params[:id]
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
geoblacklight-0.8.0 lib/geoblacklight/controller_override.rb
geoblacklight-0.7.1 lib/geoblacklight/controller_override.rb