Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include blank media when iterating through items for clusterization. #2021

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/tasks/check_khousheh.rake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading