Commit 4b7f60e65a5702a7dfeec9306909d60a5378de4e
1 parent
a0b29051
Exists in
master
and in
21 other branches
Cleaned pull request
Showing
3 changed files
with
8 additions
and
8 deletions
Show diff stats
CHANGELOG.md
lib/searchkick/query.rb
... | ... | @@ -538,10 +538,10 @@ module Searchkick |
538 | 538 | |
539 | 539 | def custom_filter(field, value, factor) |
540 | 540 | { |
541 | - filter: { | |
542 | - term: {field => value} | |
543 | - }, | |
544 | - boost_factor: factor | |
541 | + filter: { | |
542 | + term: {field => value} | |
543 | + }, | |
544 | + boost_factor: factor | |
545 | 545 | } |
546 | 546 | end |
547 | 547 | ... | ... |
test/boost_test.rb
... | ... | @@ -96,13 +96,12 @@ class TestBoost < Minitest::Test |
96 | 96 | def test_boost_where |
97 | 97 | store [ |
98 | 98 | {name: "Tomato A"}, |
99 | - {name: "Tomato B", user_ids: [1, 2, 3]}, | |
100 | - {name: "Tomato C" ,user_ids: [4, 5]}, | |
101 | - {name: "Tomato D"} | |
99 | + {name: "Tomato B", user_ids: [1, 2]}, | |
100 | + {name: "Tomato C", user_ids: [3]} | |
102 | 101 | ] |
103 | 102 | assert_first "tomato", "Tomato B", boost_where: {user_ids: 2} |
104 | 103 | assert_first "tomato", "Tomato B", boost_where: {user_ids: {value: 2, factor: 10}} |
105 | - assert_first "tomato", "Tomato C", boost_where: {user_ids: [{value: 2, factor: 10}, {value: 4, factor: 20}]} | |
104 | + assert_order "tomato", ["Tomato C", "Tomato B", "Tomato A"], boost_where: {user_ids: [{value: 1, factor: 10}, {value: 3, factor: 20}]} | |
106 | 105 | end |
107 | 106 | |
108 | 107 | def test_boost_by_distance | ... | ... |