diff --git a/CHANGELOG.md b/CHANGELOG.md index 84a8a2c8a..9f6b3f045 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ### Deprecated ### Removed ### Fixed +- Don't emit Ruby warnings when requiring `opensearch-dsl` ([#231](https://github.com/opensearch-project/opensearch-ruby/issues/231)) ### Security ## [3.2.0] diff --git a/lib/opensearch/dsl/search/options.rb b/lib/opensearch/dsl/search/options.rb index 2408a486e..ec3e0652c 100644 --- a/lib/opensearch/dsl/search/options.rb +++ b/lib/opensearch/dsl/search/options.rb @@ -55,10 +55,10 @@ def initialize(*_args) define_method name do |*args| @hash[name] = args.pop end + end - define_method name.to_s.gsub(/^_(.*)/, '\1') do |*args| - @hash[name] = args.pop - end + def source(*args) + @hash[:_source] = args.pop end # Returns true when there are no search options defined diff --git a/lib/opensearch/dsl/search/queries/match.rb b/lib/opensearch/dsl/search/queries/match.rb index c3de780b7..56f4da6dd 100644 --- a/lib/opensearch/dsl/search/queries/match.rb +++ b/lib/opensearch/dsl/search/queries/match.rb @@ -59,7 +59,6 @@ class Match option_method :lenient option_method :zero_terms_query option_method :cutoff_frequency - option_method :max_expansions end end end