diff --git a/lib/searchkick/relation.rb b/lib/searchkick/relation.rb index 091e3b1..4a1dd21 100644 --- a/lib/searchkick/relation.rb +++ b/lib/searchkick/relation.rb @@ -212,6 +212,16 @@ module Searchkick self end + def indices_boost(value) + spawn.indices_boost!(value) + end + + # TODO merge options + def indices_boost!(value) + options[:indices_boost] = value + self + end + # same as Active Record def inspect entries = results.first(11).map!(&:inspect) diff --git a/test/boost_test.rb b/test/boost_test.rb index fa88193..5642109 100644 --- a/test/boost_test.rb +++ b/test/boost_test.rb @@ -237,5 +237,8 @@ class BoostTest < Minitest::Test store_names ["Rexx"], Product assert_order "Rex", ["Rexx", "Rex"], {models: [Animal, Product], indices_boost: {Animal => 1, Product => 200}, fields: [:name]}, Searchkick + + skip "Not working yet" + assert_order_relation ["Rexx", "Rex"], Searchkick.search("Rex", relation: true).models(Animal, Product).indices_boost(Animal => 1, Product => 200).fields(:name) end end -- libgit2 0.21.0