From ad08f2707bfb097c32f60792a9210efaf5de5f18 Mon Sep 17 00:00:00 2001 From: Caio Almeida <117518+caiosba@users.noreply.github.com> Date: Wed, 4 Sep 2024 10:15:30 -0300 Subject: [PATCH] Include blank media when iterating through items for clusterization. (#2021) This is to restore the behavior of before we pushed the changes for not including blank items by default. Fixes CV2-5158. --- lib/tasks/check_khousheh.rake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/tasks/check_khousheh.rake b/lib/tasks/check_khousheh.rake index 098d9f3c0..98f467258 100644 --- a/lib/tasks/check_khousheh.rake +++ b/lib/tasks/check_khousheh.rake @@ -20,12 +20,13 @@ namespace :check do FileUtils.mkdir_p(File.join(Rails.root, 'tmp', 'feed-clusters-input')) started = Time.now.to_i sort = [{ annotated_id: { order: :asc } }] + all_types = CheckSearch::MEDIA_TYPES + ['blank'] Feed.find_each do |feed| # Only feeds that are sharing media if feed.data_points.to_a.include?(2) output = { call_id: "#{TIMESTAMP}-#{feed.uuid}", nodes: [], edges: [] } Team.current = feed.team - query = { feed_id: feed.id, feed_view: 'media', show_similar: true } + query = { feed_id: feed.id, feed_view: 'media', show_similar: true, show: all_types } es_query = CheckSearch.new(query.to_json).medias_query total = CheckSearch.new(query.to_json, nil, feed.team.id).number_of_results pages = (total / PER_PAGE.to_f).ceil @@ -211,7 +212,8 @@ namespace :check do end # Add items to clusters Team.current = feed.team - query = { feed_id: feed.id, feed_view: 'media', show_similar: true } + all_types = CheckSearch::MEDIA_TYPES + ['blank'] + query = { feed_id: feed.id, feed_view: 'media', show_similar: true, show: all_types } es_query = CheckSearch.new(query.to_json).medias_query total = CheckSearch.new(query.to_json, nil, feed.team.id).number_of_results pages = (total / PER_PAGE.to_f).ceil