From bf0a85d6829846eb6b846007c6bdb14bffc7c14e Mon Sep 17 00:00:00 2001 From: Devin Gaffney Date: Thu, 22 Aug 2024 14:22:16 -0700 Subject: [PATCH] fixes per PR review --- app/models/explainer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/explainer.rb b/app/models/explainer.rb index 58d510f88..f1599f461 100644 --- a/app/models/explainer.rb +++ b/app/models/explainer.rb @@ -108,7 +108,7 @@ def self.search_by_similarity(text, language, team_id) language: language } } - response = Bot::Alegre.index_async_with_params(params, "text") + response = Bot::Alegre.get_async_with_params(params, "text") results = response['result'].to_a.sort_by{ |result| result['_score'] } explainer_ids = results.collect{ |result| result.dig('_source', 'context', 'explainer_id').to_i }.uniq.first(3) explainer_ids.empty? ? Explainer.none : Explainer.where(team_id: team_id, id: explainer_ids)