class Elastic::Nodes::Sort
Attributes
child[RW]
Public Instance Methods
add_score_sort(order: :desc)
click to toggle source
# File lib/elastic/nodes/sort.rb, line 7 def add_score_sort(order: :desc) add_sort('_score', order: order) end
clone()
click to toggle source
Calls superclass method
Elastic::Nodes::Concerns::Sortable#clone
# File lib/elastic/nodes/sort.rb, line 11 def clone prepare_clone(super, child.try(:clone)) end
handle_result(_raw, _formatter)
click to toggle source
# File lib/elastic/nodes/sort.rb, line 29 def handle_result(_raw, _formatter) @child.handle_result(_raw, _formatter) end
render(_options = {})
click to toggle source
# File lib/elastic/nodes/sort.rb, line 23 def render(_options = {}) hash = child.render(_options) hash['sort'] = render_sorts hash end
simplify()
click to toggle source
Calls superclass method
Elastic::Nodes::Concerns::Sortable#simplify
# File lib/elastic/nodes/sort.rb, line 15 def simplify if registered_sorts.empty? child.try(:simplify) else prepare_clone(super, child.try(:simplify)) end end
traverse(&_block)
click to toggle source
Calls superclass method
Elastic::Nodes::Base#traverse
# File lib/elastic/nodes/sort.rb, line 33 def traverse(&_block) super @child.traverse(&_block) end
Private Instance Methods
prepare_clone(_clone, _child)
click to toggle source
# File lib/elastic/nodes/sort.rb, line 40 def prepare_clone(_clone, _child) _clone.child = _child _clone end