Class: Elastic::Commands::BuildSortFromParams

Inherits:
Object
  • Object
show all
Defined in:
lib/elastic/commands/build_sort_from_params.rb

Instance Method Summary collapse

Instance Method Details

#performObject



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/elastic/commands/build_sort_from_params.rb', line 3

def perform
  params.each do |param|
    case param
    when Hash
      param.each { |field, options| add_sort field, options }
    else
      add_sort param
    end
  end

  node.add_score_sort
  node
end