lib/elastic_engine/search/params.rb
# Run the sort param through a validation
#
Run the sort param through a validation
Run the sort param through a validation
def validate_sort_param(sort_param_value)
        return sort_param_value unless search.facet_klass.respond_to?(:available_sorts)
        _sort_ = search.facet_klass.available_sorts.select{|x| x.fetch(:value, '') == sort_param_value }.first
        _sort_ = search.facet_klass.available_sorts.select{|x| x.fetch(:default, false) }.first unless _sort_
        _sort_ = search.facet_klass.available_sorts.first unless _sort_
        _sort_
      end
def validate_sort_param ( sort_param_value ) return sort_param_value unless search . facet_klass . respond_to? ( :available_sorts ) _sort_ = search . facet_klass . available_sorts . select { | x | x . fetch ( :value , '' ) == sort_param_value } . first _sort_ = search . facet_klass . available_sorts . select { | x | x . fetch ( :default , false ) } . first unless _sort_ _sort_ = search . facet_klass . available_sorts . first unless _sort_ _sort_ end
Run the sort param through a validation
Run the sort param through a validation
# Get selected sort # Get default if no sort existed # Grab the first sort if none of the above apply
sort_param_value
<not_specific>