debian-mirror-gitlab/elasticsearch-model/lib/elasticsearch/model/response/suggestions.rb
2020-03-09 13:42:32 +05:30

15 lines
300 B
Ruby

module Elasticsearch
module Model
module Response
class Suggestions < HashWrapper
disable_warnings if respond_to?(:disable_warnings)
def terms
self.to_a.map { |k,v| v.first['options'] }.flatten.map {|v| v['text']}.uniq
end
end
end
end
end