Sha256: 5d661100a1b78f1a44b5d52ae071c93a5e236adadb89d6eec3474e59591d496f
Contents?: true
Size: 572 Bytes
Versions: 25
Compression:
Stored size: 572 Bytes
Contents
module Elastics class Result module MultiGet # extend if result comes from a search url def self.should_extend?(result) result.response.url =~ /\b_mget\b/ && result['docs'] end # extend the hits results on extended def self.extended(result) result['docs'].each { |h| h.extend(Document) } result['docs'].extend Struct::Paginable result['docs'].setup(result['docs'].size, result.variables) end def docs self['docs'] end alias_method :collection, :docs end end end
Version data entries
25 entries across 25 versions & 1 rubygems