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-0.3.0 lib/ddr/index/response.rb
ddr-core-0.2.2 lib/ddr/index/response.rb
ddr-core-0.2.1 lib/ddr/index/response.rb
ddr-models-2.11.0 lib/ddr/index/response.rb
ddr-models-2.10.2 lib/ddr/index/response.rb
ddr-models-2.10.1 lib/ddr/index/response.rb
ddr-models-2.10.0 lib/ddr/index/response.rb
ddr-models-2.10.0.rc2 lib/ddr/index/response.rb
ddr-models-2.10.0.rc1 lib/ddr/index/response.rb
ddr-models-2.9.2 lib/ddr/index/response.rb
ddr-models-2.9.1 lib/ddr/index/response.rb
ddr-models-2.9.0 lib/ddr/index/response.rb
ddr-models-2.9.0.rc1 lib/ddr/index/response.rb
ddr-models-2.8.0 lib/ddr/index/response.rb
ddr-models-2.8.0.rc1 lib/ddr/index/response.rb
ddr-models-2.7.6 lib/ddr/index/response.rb
ddr-models-2.7.5 lib/ddr/index/response.rb
ddr-models-2.7.4 lib/ddr/index/response.rb
ddr-models-2.7.3 lib/ddr/index/response.rb
ddr-models-2.7.2 lib/ddr/index/response.rb