Commit e5143356f383e12a7b1c70fabfedb2b0c2dd16f2

Authored by Andrew
1 parent 62892244

Fixed deprecation warnings in code

Showing 1 changed file with 3 additions and 3 deletions   Show diff stats
lib/searchkick/query.rb
... ... @@ -660,11 +660,11 @@ module Searchkick
660 660 def set_boost_by_indices(payload)
661 661 return unless options[:indices_boost]
662 662  
663   - indices_boost = options[:indices_boost].each_with_object({}) do |(key, boost), memo|
  663 + indices_boost = options[:indices_boost].map do |key, boost|
664 664 index = key.respond_to?(:searchkick_index) ? key.searchkick_index.name : key
665 665 # try to use index explicitly instead of alias: https://github.com/elasticsearch/elasticsearch/issues/4756
666 666 index_by_alias = Searchkick.client.indices.get_alias(index: index).keys.first
667   - memo[index_by_alias || index] = boost
  667 + {(index_by_alias || index) => boost}
668 668 end
669 669  
670 670 payload[:indices_boost] = indices_boost
... ... @@ -812,7 +812,7 @@ module Searchkick
812 812 # TODO id transformation for arrays
813 813 def set_order(payload)
814 814 order = options[:order].is_a?(Enumerable) ? options[:order] : {options[:order] => :asc}
815   - id_field = :_uid
  815 + id_field = below60? ? :_uid : :_id
816 816 payload[:sort] = order.is_a?(Array) ? order : Hash[order.map { |k, v| [k.to_s == "id" ? id_field : k, v] }]
817 817 end
818 818  
... ...