diff --git a/CHANGELOG.md b/CHANGELOG.md index ce8449b..51f2507 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## 4.6.1 (unreleased) - Added `ilike` operator for Elasticsearch 7.10+ +- Fixed missing methods with `multi_search` ## 4.6.0 (2021-08-22) diff --git a/lib/searchkick/query.rb b/lib/searchkick/query.rb index 2aa7c0c..9bad94f 100644 --- a/lib/searchkick/query.rb +++ b/lib/searchkick/query.rb @@ -1,5 +1,6 @@ module Searchkick class Query + include Enumerable extend Forwardable @@metric_aggs = [:avg, :cardinality, :max, :min, :sum] @@ -13,7 +14,7 @@ module Searchkick :current_page, :per_page, :limit_value, :padding, :total_pages, :num_pages, :offset_value, :offset, :previous_page, :prev_page, :next_page, :first_page?, :last_page?, :out_of_range?, :hits, :response, :to_a, :first, :scroll, :highlights, :with_highlights, - :with_score, :misspellings?, :scroll_id, :clear_scroll, :missing_records + :with_score, :misspellings?, :scroll_id, :clear_scroll, :missing_records, :with_hit def initialize(klass, term = "*", **options) unknown_keywords = options.keys - [:aggs, :block, :body, :body_options, :boost, diff --git a/test/multi_search_test.rb b/test/multi_search_test.rb index ef8afc2..c98282b 100644 --- a/test/multi_search_test.rb +++ b/test/multi_search_test.rb @@ -11,6 +11,12 @@ class MultiSearchTest < Minitest::Test assert_equal ["Store A"], stores.map(&:name) end + def test_methods + result = Product.search("*") + query = Product.search("*", execute: false) + assert_empty(result.methods - query.methods) + end + def test_error store_names ["Product A"] products = Product.search("*", execute: false) -- libgit2 0.21.0