diff --git a/lib/searchkick.rb b/lib/searchkick.rb index d316e90..69263dc 100644 --- a/lib/searchkick.rb +++ b/lib/searchkick.rb @@ -114,7 +114,7 @@ module Searchkick end options = options.merge(block: block) if block - if relation || (relation.nil? && Searchick.relation) + if relation || (relation.nil? && Searchkick.relation) Searchkick::Relation.new(klass, term, **options) else query = Searchkick::Query.new(klass, term, **options) diff --git a/test/autocomplete_test.rb b/test/autocomplete_test.rb index 06359a7..3d5fa33 100644 --- a/test/autocomplete_test.rb +++ b/test/autocomplete_test.rb @@ -74,6 +74,7 @@ class AutocompleteTest < Minitest::Test def test_exact store_names ["hi@example.org"] assert_search "hi@example.org", ["hi@example.org"], fields: [{name: :exact}] + assert_search_relation ["hi@example.org"], Product.search("hi@example.org", relation: true).fields(name: :exact) end def test_exact_case diff --git a/test/test_helper.rb b/test/test_helper.rb index 295024d..b18f671 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -14,7 +14,7 @@ Searchkick.client.transport.logger = $logger Searchkick.search_timeout = 5 Searchkick.index_suffix = ENV["TEST_ENV_NUMBER"] # for parallel tests -Searchkick.relation = ENV["RELATION"] +# Searchkick.relation = ENV["RELATION"] # add to elasticsearch-7.0.0/config/ Searchkick.wordnet_path = "wn_s.pl" if ENV["WORDNET"] -- libgit2 0.21.0