Content-Length: 348845 | pFad | https://github.com/internetarchive/openlibrary/pull/9545

B8 Aggregate want to read counts by author by benbdeitch · Pull Request #9545 · internetarchive/openlibrary · GitHub
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

Aggregate want to read counts by author #9545

Conversation

benbdeitch
Copy link
Collaborator

@benbdeitch benbdeitch commented Jul 9, 2024

Closes #9359

This PR adds summed counts for each of an authors's works' readinglog counts to the author, which will be useful for popularity measures later down the line.

Technical

The request sent to Solr has been changed to use the Solr JSON endpoint, thus necessitating it to be a POST request rather than GET. This allows for aggregations like 'sum' to be easily executed within the request.

A few changes to the return format were made, due to the way in which the Facet API returns data. Notably, each facet is now under the same category, with 'subject', 'place' and '

Testing

Simply edit an author's page or reindex their key via the Admin Solr endpoint, and look for the new 'want_to_read_count' or 'readinglog_facets` categories upon requesting their Solr data.

Screenshot

Stakeholders

@cdrini

@benbdeitch benbdeitch marked this pull request as draft July 9, 2024 20:34
@benbdeitch benbdeitch changed the title 9359/feature/aggregate want to read counts by author (DRAFT PR) 9359/feature/aggregate want to read counts by author Jul 9, 2024
@benbdeitch benbdeitch marked this pull request as ready for review July 18, 2024 19:52
Copy link
Collaborator

@cdrini cdrini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great! Some code feedback

openlibrary/solr/updater/author.py Outdated Show resolved Hide resolved
openlibrary/solr/updater/author.py Outdated Show resolved Hide resolved
openlibrary/solr/updater/author.py Outdated Show resolved Hide resolved
openlibrary/solr/updater/author.py Outdated Show resolved Hide resolved
openlibrary/solr/updater/author.py Outdated Show resolved Hide resolved
@cdrini cdrini changed the title 9359/feature/aggregate want to read counts by author Aggregate want to read counts by author Jul 31, 2024
Copy link
Collaborator

@cdrini cdrini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm! Tested case where no counts, and no facets and it worked. Tested adding a work to currently reading, solr update, edit author, solr update, and the counts were updated!

@cdrini cdrini merged commit 62d2243 into internetarchive:master Jul 31, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Aggregate want-to-read counts from works onto authors
2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/internetarchive/openlibrary/pull/9545

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy