Commit f75733fd6007694ac0dbd53c298f008a9c1de549

Authored by Andrew Kane
1 parent ee62747a
Exists in master

Improved error message for unsupported versions of Elasticsearch - #1569

Showing 2 changed files with 2 additions and 1 deletions   Show diff stats
1 ## 5.0.4 (unreleased) 1 ## 5.0.4 (unreleased)
2 2
3 - Added `max_result_window` option 3 - Added `max_result_window` option
  4 +- Improved error message for unsupported versions of Elasticsearch
4 5
5 ## 5.0.3 (2022-03-13) 6 ## 5.0.3 (2022-03-13)
6 7
lib/searchkick/index.rb
@@ -418,7 +418,7 @@ module Searchkick @@ -418,7 +418,7 @@ module Searchkick
418 true 418 true
419 end 419 end
420 rescue => e 420 rescue => e
421 - if Searchkick.transport_error?(e) && e.message.include?("No handler for type [text]") 421 + if Searchkick.transport_error?(e) && (e.message.include?("No handler for type [text]") || e.message.include?("class java.util.ArrayList cannot be cast to class java.util.Map"))
422 raise UnsupportedVersionError 422 raise UnsupportedVersionError
423 end 423 end
424 424