Commit 5d1141a6901a088d233d306520f451128ec67385
1 parent
95553b49
Exists in
master
and in
21 other branches
Code style fixes
Showing
4 changed files
with
7 additions
and
8 deletions
Show diff stats
lib/searchkick/logging.rb
lib/searchkick/query.rb
@@ -71,11 +71,11 @@ module Searchkick | @@ -71,11 +71,11 @@ module Searchkick | ||
71 | if status_code == 404 | 71 | if status_code == 404 |
72 | raise MissingIndexError, "Index missing - run #{reindex_command}" | 72 | raise MissingIndexError, "Index missing - run #{reindex_command}" |
73 | elsif status_code == 500 && ( | 73 | elsif status_code == 500 && ( |
74 | - e.message.include?("IllegalArgumentException[minimumSimilarity >= 1]") || | ||
75 | - e.message.include?("No query registered for [multi_match]") || | ||
76 | - e.message.include?("[match] query does not support [cutoff_frequency]]") || | ||
77 | - e.message.include?("No query registered for [function_score]]") | ||
78 | - ) | 74 | + e.message.include?("IllegalArgumentException[minimumSimilarity >= 1]") || |
75 | + e.message.include?("No query registered for [multi_match]") || | ||
76 | + e.message.include?("[match] query does not support [cutoff_frequency]]") || | ||
77 | + e.message.include?("No query registered for [function_score]]") | ||
78 | + ) | ||
79 | 79 | ||
80 | raise UnsupportedVersionError, "This version of Searchkick requires Elasticsearch 1.0 or greater" | 80 | raise UnsupportedVersionError, "This version of Searchkick requires Elasticsearch 1.0 or greater" |
81 | elsif status_code == 400 | 81 | elsif status_code == 400 |
lib/searchkick/results.rb
@@ -47,7 +47,7 @@ module Searchkick | @@ -47,7 +47,7 @@ module Searchkick | ||
47 | 47 | ||
48 | if hit["highlight"] | 48 | if hit["highlight"] |
49 | highlight = Hash[hit["highlight"].map { |k, v| [base_field(k), v.first] }] | 49 | highlight = Hash[hit["highlight"].map { |k, v| [base_field(k), v.first] }] |
50 | - options[:highlighted_fields].map{ |k| base_field(k) }.each do |k| | 50 | + options[:highlighted_fields].map { |k| base_field(k) }.each do |k| |
51 | result["highlighted_#{k}"] ||= (highlight[k] || result[k]) | 51 | result["highlighted_#{k}"] ||= (highlight[k] || result[k]) |
52 | end | 52 | end |
53 | end | 53 | end |
test/aggs_test.rb
@@ -21,7 +21,7 @@ class AggsTest < Minitest::Test | @@ -21,7 +21,7 @@ class AggsTest < Minitest::Test | ||
21 | 21 | ||
22 | def test_order | 22 | def test_order |
23 | agg = Product.search("Product", aggs: {color: {order: {"_term" => "desc"}}}).aggs["color"] | 23 | agg = Product.search("Product", aggs: {color: {order: {"_term" => "desc"}}}).aggs["color"] |
24 | - assert_equal %w[red green blue], agg["buckets"].map { |b| b["key"] } | 24 | + assert_equal %w(red green blue), agg["buckets"].map { |b| b["key"] } |
25 | end | 25 | end |
26 | 26 | ||
27 | def test_field | 27 | def test_field |