app/services/blacklight/search_service.rb
##
# Pagination parameters for selecting the previous and next documents
# out of a result set.
Pagination parameters for selecting the previous and next documents
out of a result set.
Pagination parameters for selecting the previous and next documents out of a result set .
def previous_and_next_document_params(index, window = 1)
      solr_params = blacklight_config.document_pagination_params.dup
      if solr_params.empty?
        solr_params[:fl] = blacklight_config.document_model.unique_key
      end
      if index > 0
        solr_params[:start] = index - window 
        solr_params[:rows] = 2 * window + 1 
      else
        solr_params[:start] = 0 
        solr_params[:rows] = 2 * window 
      end
      solr_params[:facet] = false
      solr_params
    end
def previous_and_next_document_params ( index , window = 1 ) solr_params = blacklight_config . document_pagination_params . dup if solr_params . empty? solr_params [ :fl ] = blacklight_config . document_model . unique_key end if index > 0 solr_params [ :start ] = index - window solr_params [ :rows ] = 2 * window + 1 else solr_params [ :start ] = 0 solr_params [ :rows ] = 2 * window end solr_params [ :facet ] = false solr_params end
Pagination parameters for selecting the previous and next documents
out of a result set.
Pagination parameters for selecting the previous and next documents out of a result set .
# get one before # and one after # there is no previous doc # but there should be one after
index
<not_specific>
window
<not_specific>