debian-mirror-gitlab/elasticsearch-rails/elasticsearch-model/lib/elasticsearch/model/response/suggestions.rb

16 lines
300 B
Ruby
Raw Normal View History

2019-12-22 22:52:31 +05:30
module Elasticsearch
module Model
module Response
2020-03-13 15:44:24 +05:30
class Suggestions < HashWrapper
disable_warnings if respond_to?(:disable_warnings)
2019-12-22 22:52:31 +05:30
def terms
self.to_a.map { |k,v| v.first['options'] }.flatten.map {|v| v['text']}.uniq
end
end
end
end
end