class ElasticSearch::Api::Hits
Attributes
_shards[R]
facets[R]
hits[R]
response[R]
scroll_id[R]
total_entries[R]
Public Class Methods
new(response, options={})
click to toggle source
# File lib/elasticsearch/client/hits.rb, line 48 def initialize(response, options={}) @response = response @options = options @total_entries = response["hits"]["total"] @_shards = response["_shards"] @facets = response["facets"] @scroll_id = response["_scroll_id"] || response["_scrollId"] populate(@options[:ids_only]) end
Public Instance Methods
freeze()
click to toggle source
Calls superclass method
# File lib/elasticsearch/client/hits.rb, line 62 def freeze @hits.freeze super end
method_missing(method, *args, &block)
click to toggle source
# File lib/elasticsearch/client/hits.rb, line 67 def method_missing(method, *args, &block) @hits.send(method, *args, &block) end
respond_to?(method, include_private = false)
click to toggle source
Calls superclass method
# File lib/elasticsearch/client/hits.rb, line 71 def respond_to?(method, include_private = false) super || @hits.respond_to?(method, include_private) end
to_a()
click to toggle source
# File lib/elasticsearch/client/hits.rb, line 58 def to_a @hits end
Private Instance Methods
populate(ids_only=false)
click to toggle source
# File lib/elasticsearch/client/hits.rb, line 77 def populate(ids_only=false) @hits = @response["hits"]["hits"].collect { |h| ids_only ? h["_id"] : Hit.new(h) } end