Add task to update kudos count on indexed works

Description

The migration in will de-duplicate kudos on works, and we need to reindex them to keep the kudos sorting option on work searches/filters accurate. One more After task.

  • The task should only consider works with kudos.

  • The task should use StatCounterIndexer. We want to update the existing indexed works, we don't have to reindex whole works. The task should not reindex bookmarked works (a different index that doesn't track kudos count).

  • The task should process in batches and sensibly print its progress.

How to test:

  • Admins can edit a work's stat_counter to have some absurd kudos count.

  • Reindex the work to put it at the top of any kudos descending list.

  • Run the task.

  • Check that the work is positioned correctly in kudos descending lists.

On beta, this task should be run after AO3-5869.

Activity

Show:
redsummernight
March 8, 2020, 6:00 PM

The work is reindexed and now appears where it should:

You searched for: Author/Artist: redsummernight kudos count: 3 sort by: best match descending

Looks good.

james_
March 15, 2020, 8:27 AM

Pressed the reindex work button.

Work did not appear at the top of the search

WorkIndexer.new([w.id]).index_documents

Work now at top of search, start the rake task

bundle exec rake After:update_indexed_stat_counter_kudo_count

 

james_
March 15, 2020, 9:19 AM

Batch 769 of 769 complete

 

ao3app@test-front11:~/app/current$ bundle exec rails runner ~/bin/queue_status.rb
Traditionally wrangling staff has said
If reindex_low is at 500 or above, please don't wrangle large tags.
If it's above 1000, please stop wrangling for a bit and wait for it to go back down.

Current Time : 2020-03-15 09:18:57 +0000
Total pending jobs: 0
Total workers: 21
Workers working: 0

reindex_stats 0
mailer 0
utilities 0
reindex_cleanup 0
collection 0
reindex_high 0
reindex_failures 0
reindex_low 0
reindex_world 0

All seems well

 

james_
March 15, 2020, 9:20 AM

 

Looks good

redsummernight
March 20, 2020, 12:28 AM

We ran this on beta on Mar 18-19.

Done

Assignee

Sarken

Reporter

redsummernight

Roadmap

Misc
Search

Priority

Medium

Affects versions

Fix versions

Components

BackEnd

Difficulty

Medium

Milestone

Internal 0.9
Configure