Commit 144576879a263911c31e15ff45f5be402d03fd52
Committed by
Andrew Kane
1 parent
cb3b02c1
Exists in
master
and in
21 other branches
Fix test warnings (#723)
Showing
4 changed files
with
7 additions
and
6 deletions
Show diff stats
lib/searchkick.rb
... | ... | @@ -40,7 +40,7 @@ module Searchkick |
40 | 40 | @client ||= |
41 | 41 | Elasticsearch::Client.new( |
42 | 42 | url: ENV["ELASTICSEARCH_URL"], |
43 | - transport_options: {request: {timeout: timeout}} | |
43 | + transport_options: {request: {timeout: timeout}, headers: { content_type: 'application/json' }} | |
44 | 44 | ) do |f| |
45 | 45 | f.use Searchkick::Middleware |
46 | 46 | end | ... | ... |
lib/searchkick/index.rb
lib/searchkick/query.rb
... | ... | @@ -29,6 +29,7 @@ module Searchkick |
29 | 29 | @term = term |
30 | 30 | @options = options |
31 | 31 | @match_suffix = options[:match] || searchkick_options[:match] || "analyzed" |
32 | + @type = @routing = @misspellings_below = @highlighted_fields = nil | |
32 | 33 | |
33 | 34 | prepare |
34 | 35 | end |
... | ... | @@ -400,7 +401,7 @@ module Searchkick |
400 | 401 | payload = payload.deep_merge(options[:body_options]) if options[:body_options] |
401 | 402 | |
402 | 403 | @body = payload |
403 | - @facet_limits = @facet_limits || {} | |
404 | + @facet_limits ||= {} | |
404 | 405 | @page = page |
405 | 406 | @per_page = per_page |
406 | 407 | @padding = padding |
... | ... | @@ -752,8 +753,8 @@ module Searchkick |
752 | 753 | filters << {bool: {must_not: term_filters(field, op_value)}} |
753 | 754 | end |
754 | 755 | when :all |
755 | - op_value.each do |value| | |
756 | - filters << term_filters(field, value) | |
756 | + op_value.each do |val| | |
757 | + filters << term_filters(field, val) | |
757 | 758 | end |
758 | 759 | when :in |
759 | 760 | filters << term_filters(field, op_value) | ... | ... |
test/errors_test.rb