Class: Elastic::Nodes::TopHits
- Includes:
- Concerns::HitProvider
- Defined in:
- lib/elastic/nodes/agg/top_hits.rb
Instance Attribute Summary
Attributes included from Concerns::HitProvider
Attributes inherited from BaseAgg
Instance Method Summary collapse
Methods included from Concerns::HitProvider
Methods inherited from BaseAgg
build, #clone, #initialize, #simplify
Methods inherited from Base
#==, #clone, #simplify, #traverse
Methods included from Support::Traversable
Constructor Details
This class inherits a constructor from Elastic::Nodes::BaseAgg
Instance Method Details
#handle_result(_raw, _formatter) ⇒ Object
12 13 14 15 |
# File 'lib/elastic/nodes/agg/top_hits.rb', line 12 def handle_result(_raw, _formatter) hits = _raw['hits'] ? prepare_hits(_raw['hits']['hits'], _formatter) : [] Elastic::Results::HitCollection.new(hits) end |
#render(_options = {}) ⇒ Object
5 6 7 8 9 10 |
# File 'lib/elastic/nodes/agg/top_hits.rb', line 5 def render( = {}) hash = {} hash { 'top_hits' => hash } end |