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.6.1 lib/ddr/index/response.rb
ddr-core-1.6.0 lib/ddr/index/response.rb
ddr-core-1.5.5 lib/ddr/index/response.rb
ddr-core-1.5.4 lib/ddr/index/response.rb
ddr-core-1.5.2 lib/ddr/index/response.rb
ddr-core-1.5.3 lib/ddr/index/response.rb
ddr-core-1.5.1 lib/ddr/index/response.rb
ddr-core-1.4.4 lib/ddr/index/response.rb
ddr-core-1.4.3 lib/ddr/index/response.rb
ddr-core-1.4.2 lib/ddr/index/response.rb
ddr-core-1.4.0 lib/ddr/index/response.rb
ddr-core-1.3.0 lib/ddr/index/response.rb
ddr-core-1.2.0 lib/ddr/index/response.rb
ddr-core-1.2.0.rc3 lib/ddr/index/response.rb
ddr-core-1.2.0.rc2 lib/ddr/index/response.rb
ddr-core-1.2.0.rc1 lib/ddr/index/response.rb
ddr-core-1.1.2 lib/ddr/index/response.rb
ddr-core-1.1.1 lib/ddr/index/response.rb
ddr-core-1.1.0 lib/ddr/index/response.rb
ddr-core-1.0.0 lib/ddr/index/response.rb