Sha256: 9bbc7aac4ed768ac40cc8ed5a44e42d701b122e12fc358c77f39fdf90f7d8af1
Contents?: true
Size: 762 Bytes
Versions: 2
Compression:
Stored size: 762 Bytes
Contents
module Sequel module Plugins module Elasticsearch class Result include Enumerable attr_reader :results, :scroll_id, :total, :took, :timed_out def initialize(results) return unless results && results['hits'] @results = results @scroll_id = results['_scroll_id'] @total = results['hits']['total'] @timed_out = results['timed_out'] @took = results['took'] end def each return [] unless results['hits'] && results['hits']['hits'] results['hits']['hits'].each { |h| yield h } # TODO: Use the scroll id to get more if needed # We will need access to the client, somehow... end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
sequel-elasticsearch-0.3.2 | lib/sequel/plugins/elasticsearch/result.rb |
sequel-elasticsearch-0.3.0 | lib/sequel/plugins/elasticsearch/result.rb |