Commit 05b192c13a52deea6da8161f11e83087127c0615
1 parent
a8bde580
Exists in
master
and in
18 other branches
Fixed debug - closes #1106 [skip ci]
Showing
2 changed files
with
9 additions
and
1 deletions
Show diff stats
lib/searchkick/query.rb
... | ... | @@ -135,7 +135,7 @@ module Searchkick |
135 | 135 | if searchkick_index |
136 | 136 | puts "Model Search Data" |
137 | 137 | begin |
138 | - pp(klass.first(3).map { |r| {index: searchkick_index.record_data(r).merge(data: searchkick_index.send(:search_data, r))}}) | |
138 | + pp klass.first(3).map { |r| RecordData.new(searchkick_index, r).index_data } | |
139 | 139 | rescue => e |
140 | 140 | puts "#{e.class.name}: #{e.message}" |
141 | 141 | end | ... | ... |
test/query_test.rb
... | ... | @@ -32,4 +32,12 @@ class QueryTest < Minitest::Test |
32 | 32 | def test_request_params |
33 | 33 | assert_equal "dfs_query_then_fetch", Product.search("*", request_params: {search_type: "dfs_query_then_fetch"}, execute: false).params[:search_type] |
34 | 34 | end |
35 | + | |
36 | + def test_debug | |
37 | + store_names ["Milk"] | |
38 | + out, _ = capture_io do | |
39 | + assert_search "milk", ["Milk"], debug: true | |
40 | + end | |
41 | + refute_includes out, "Error" | |
42 | + end | |
35 | 43 | end | ... | ... |