Sha256: 28008567e58bb9795648198a2f4968b784c94b44d2e5c6d1486a5eda93d56fad

Contents?: true

Size: 380 Bytes

Versions: 1

Compression:

Stored size: 380 Bytes

Contents

module Elastic::Nodes
  class TopHits < BaseAgg
    include Concerns::HitProvider

    def render
      options = {}
      render_hit_options options

      { 'top_hits' => options }
    end

    def handle_result(_raw)
      hits = _raw['hits'] ? _raw['hits']['hits'].map { |h| Elastic::Results::Hit.new h } : []
      Elastic::Results::HitCollection.new(hits)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
elastic-rails-0.5.0 lib/elastic/nodes/agg/top_hits.rb