Sha256: 78d2ac93d8f28a00db95af25da077953a8078ad10dfcbbd18ac9e599ab04e975

Contents?: true

Size: 413 Bytes

Versions: 79

Compression:

Stored size: 413 Bytes

Contents

require "delegate"

module Ddr::Index
  #
  # Wraps an index query response
  #
  class Response < SimpleDelegator

    def docs
      response["docs"]
    end

    def num_found
      response["numFound"].to_i
    end

    def facet_counts
      self["facet_counts"] || {}
    end

    def facet_fields
      facet_counts["facet_fields"] || {}
    end

    def response
      self["response"]
    end

  end
end

Version data entries

79 entries across 79 versions & 2 rubygems

Version Path
ddr-models-2.7.1 lib/ddr/index/response.rb
ddr-models-2.7.0 lib/ddr/index/response.rb
ddr-models-2.7.0.rc1 lib/ddr/index/response.rb
ddr-models-2.6.2 lib/ddr/index/response.rb
ddr-models-2.6.1 lib/ddr/index/response.rb
ddr-models-2.6.0 lib/ddr/index/response.rb
ddr-models-2.6.0.rc4 lib/ddr/index/response.rb
ddr-models-2.6.0.rc3 lib/ddr/index/response.rb
ddr-models-2.6.0.rc2 lib/ddr/index/response.rb
ddr-models-2.6.0.rc1 lib/ddr/index/response.rb
ddr-models-2.5.3 lib/ddr/index/response.rb
ddr-models-2.5.2 lib/ddr/index/response.rb
ddr-models-2.5.1 lib/ddr/index/response.rb
ddr-models-2.5.0 lib/ddr/index/response.rb
ddr-models-2.5.0.rc1 lib/ddr/index/response.rb
ddr-models-2.4.16 lib/ddr/index/response.rb
ddr-models-2.4.15 lib/ddr/index/response.rb
ddr-models-2.4.14 lib/ddr/index/response.rb
ddr-models-2.4.13 lib/ddr/index/response.rb