Commit 31e1547598b5660a1bf7d5eae5aa57c40e37af8c
1 parent
1d0702a6
Exists in
master
and in
19 other branches
Updated readme [skip ci]
Showing
1 changed file
with
3 additions
and
2 deletions
Show diff stats
README.md
... | ... | @@ -1291,12 +1291,13 @@ class ReindexConversionsJob < ActiveJob::Base |
1291 | 1291 | |
1292 | 1292 | # split into groups |
1293 | 1293 | recently_converted_ids.in_groups_of(1000, false) do |ids| |
1294 | - # fetch conversions and group by record | |
1295 | - conversions_by_record = {} | |
1294 | + # fetch conversions | |
1296 | 1295 | conversions = |
1297 | 1296 | Searchjoy::Search.where(convertable_id: ids, convertable_type: class_name) |
1298 | 1297 | .group(:convertable_id, :query).uniq.count(:user_id) |
1299 | 1298 | |
1299 | + # group conversions by record | |
1300 | + conversions_by_record = {} | |
1300 | 1301 | conversions.each do |(id, query), count| |
1301 | 1302 | (conversions_by_record[id] ||= {})[query] = count |
1302 | 1303 | end | ... | ... |