Sha256: 80ae2d0d8879a21201ab16ae394bb56d3af6e12cf3d7caf530c35c13ed0f233e
Contents?: true
Size: 533 Bytes
Versions: 13
Compression:
Stored size: 533 Bytes
Contents
module Searchkick class Results < Tire::Results::Collection def suggestions if @response["suggest"] @response["suggest"].values.flat_map{|v| v.first["options"] }.sort_by{|o| -o["score"] }.map{|o| o["text"] }.uniq else raise "Pass `suggest: true` to the search method for suggestions" end end # fixes deprecation warning def __find_records_by_ids(klass, ids) @options[:load] === true ? klass.find(ids) : klass.includes(@options[:load][:include]).find(ids) end end end
Version data entries
13 entries across 13 versions & 1 rubygems