Commit a9041a92a6c49e559f92906273acb8625607f4bb
1 parent
f5f8aaf7
Exists in
master
and in
17 other branches
Fixed issue with misspellings below and body block - closes #1244
Showing
3 changed files
with
6 additions
and
2 deletions
Show diff stats
CHANGELOG.md
lib/searchkick.rb
lib/searchkick/query.rb
... | ... | @@ -15,7 +15,7 @@ module Searchkick |
15 | 15 | :out_of_range?, :hits, :response, :to_a, :first |
16 | 16 | |
17 | 17 | def initialize(klass, term = "*", **options) |
18 | - unknown_keywords = options.keys - [:aggs, :body, :body_options, :boost, | |
18 | + unknown_keywords = options.keys - [:aggs, :block, :body, :body_options, :boost, | |
19 | 19 | :boost_by, :boost_by_distance, :boost_by_recency, :boost_where, :conversions, :conversions_term, :debug, :emoji, :exclude, :execute, :explain, |
20 | 20 | :fields, :highlight, :includes, :index_name, :indices_boost, :limit, :load, |
21 | 21 | :match, :misspellings, :model_includes, :offset, :operator, :order, :padding, :page, :per_page, :profile, |
... | ... | @@ -483,6 +483,9 @@ module Searchkick |
483 | 483 | # merge more body options |
484 | 484 | payload = payload.deep_merge(options[:body_options]) if options[:body_options] |
485 | 485 | |
486 | + # run block | |
487 | + options[:block].call(payload) if options[:block] | |
488 | + | |
486 | 489 | @body = payload |
487 | 490 | @page = page |
488 | 491 | @per_page = per_page | ... | ... |