Sha256: 61bc06976efc5e3d81a52923e7e0d6944f2d26422d28bbd811eb0fc9c88432af

Contents?: true

Size: 241 Bytes

Versions: 3

Compression:

Stored size: 241 Bytes

Contents

module Elasticsearch
  module Model
    module Response

      class Suggestions < Hashie::Mash
        def terms
          self.to_a.map { |k,v| v.first['options'] }.flatten.map {|v| v['text']}.uniq
        end
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
elasticsearch-model-2.0.1 lib/elasticsearch/model/response/suggestions.rb
elasticsearch-model-2.0.0 lib/elasticsearch/model/response/suggestions.rb
elasticsearch-model-0.1.9 lib/elasticsearch/model/response/suggestions.rb