debian-mirror-gitlab/elasticsearch-rails/elasticsearch-model/lib/elasticsearch/model/response/suggestions.rb
2021-03-05 16:19:46 +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