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-core-1.17.0 lib/ddr/index/response.rb
ddr-core-1.16.0 lib/ddr/index/response.rb
ddr-core-1.15.0 lib/ddr/index/response.rb
ddr-core-1.14.0 lib/ddr/index/response.rb
ddr-core-1.13.2 lib/ddr/index/response.rb
ddr-core-1.13.1 lib/ddr/index/response.rb
ddr-core-1.13.0 lib/ddr/index/response.rb
ddr-core-1.12.2 lib/ddr/index/response.rb
ddr-core-1.12.1 lib/ddr/index/response.rb
ddr-core-1.12.0 lib/ddr/index/response.rb
ddr-core-1.11.0 lib/ddr/index/response.rb
ddr-core-1.10.0 lib/ddr/index/response.rb
ddr-core-1.9.0 lib/ddr/index/response.rb
ddr-core-1.8.0 lib/ddr/index/response.rb
ddr-core-1.7.0 lib/ddr/index/response.rb
ddr-core-1.6.6 lib/ddr/index/response.rb
ddr-core-1.6.5 lib/ddr/index/response.rb
ddr-core-1.6.4 lib/ddr/index/response.rb
ddr-core-1.6.3 lib/ddr/index/response.rb
ddr-core-1.6.2 lib/ddr/index/response.rb