Commit 6d84b2b523a49ba2c206a2ece102f2e1d6907423
1 parent
a662e766
Exists in
master
and in
21 other branches
Added searchkick_debug method
Showing
2 changed files
with
11 additions
and
0 deletions
Show diff stats
CHANGELOG.md
lib/searchkick/model.rb
... | ... | @@ -69,6 +69,16 @@ module Searchkick |
69 | 69 | def searchkick_index_options |
70 | 70 | searchkick_index.index_options |
71 | 71 | end |
72 | + | |
73 | + def searchkick_debug | |
74 | + require "pp" | |
75 | + pp ({ | |
76 | + searchkick_options: searchkick_options, | |
77 | + mapping: searchkick_index.mapping, | |
78 | + search_data: first(3).map { |r| {index: searchkick_index.record_data(r).merge(data: searchkick_index.send(:search_data, r))}} | |
79 | + }) | |
80 | + nil # do not return anything, as this is strictly used for manual debugging | |
81 | + end | |
72 | 82 | end |
73 | 83 | extend Searchkick::Reindex # legacy for Searchjoy |
74 | 84 | ... | ... |