feat(search): add summary, country, collection, and rating search fields - #1801
Open
chrisbenincasa wants to merge 1 commit into
Open
chrisbenincasa wants to merge 1 commit into
chrisbenincasa wants to merge 1 commit into
Conversation
chrisbenincasa
marked this pull request as ready for review
April 20, 2026 16:42
Adds five fields to the program search index, the search DSL, and the web search builder: summary string country faceted string collection faceted string audience_rating numeric, also sortable critic_rating numeric, also sortable Plex and Jellyfin populate them while scanning a library. Plex movies take the audience score from `audienceRating` and the critic score from `rating`, and take countries and collections from the `Country` and `Collection` join items. Plex shows have no critic score, so it stays null. Jellyfin maps `CommunityRating` and `CriticRating`, and takes countries from `ProductionLocations`; its library request now asks for those three fields. Jellyfin has no collection equivalent, so collections stay empty. Emby is not wired up and returns nothing for any of the five. The web search builder shows all five for movie and show libraries only. Migration 0052 adds nullable `audience_rating` and `critic_rating` REAL columns to `program`. `ProgramDaoMinter.mintMovie` writes them, and `ProgramConverter` and `ApiProgramConverters` read them back, so a movie keeps its ratings across a database round trip and an index rebuilt from the database keeps them too. Ratings on shows are not persisted. `program_grouping` has no columns for them, so an episode inherits its show's ratings only when the show came from a deep scan. Countries and collections are not persisted either, for movies or shows, since they need join tables rather than columns. Both reach Meilisearch from the scanner's in-memory objects and survive until the index is rebuilt. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
chrisbenincasa
force-pushed
the
extra-search-fields
branch
from
September 23, 2026 00:57
9b4fae3 to
291384b
Compare
This was referenced Sep 23, 2026
Open
Owner
Author
|
Follow-ups filed for the gaps listed under What is not persisted:
Also #2147 for the |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds five fields to the program search index, the search DSL, and the web search builder.
summarysummarycountrycountries.namecollectioncollections.nameaudience_ratingaudienceRatingcritic_ratingcriticRatingAll five appear in the web search builder for movie and show libraries only.
Where the values come from
audienceRatingratingCountryCollectionaudienceRatingCountryCollectionCommunityRatingCriticRatingProductionLocationsCommunityRatingCriticRatingProductionLocationsThe Jellyfin library request now asks for
ProductionLocations,CommunityRating, andCriticRating.PlexMovieSchemagains an optionalCollectionarray.Database
Migration
0052_next_eternals.sql:Movie ratings persist end to end.
ProgramDaoMinter.mintMoviewrites both columns, andProgramConverter.programDaoToTerminalProgramplusApiProgramConvertersread them back, so a movie keeps its ratings across a database round trip and an index rebuilt from the database keeps them too.What is not persisted
Search works for all five fields on freshly scanned items, because the scanner hands Meilisearch its in-memory media objects. The following only survive until the index is rebuilt, and are filed as follow-ups rather than fixed here.
program_groupinghas no rating columns, so an episode inherits its show's ratings only when the show came from a deep scan. A shallow re-scan materializes the show from the database and the episode gets null.EmbyApiClientsets only the content rating and returns nothing for any of the five fields.Notes for review
This branch was rebased from a 325-commit-old base. Two things changed during the rebase:
0044_add_audience_critic_ratingcollided with0044–0051on main. It was regenerated as0052viapnpm resolve-migrations; the SQL is byte-identical to the original.// library_name,// media_source_name) and a redundant identity mapping (summary: 'summary') were dropped fromvirtualFieldToIndexField. Every read site doesvirtualFieldToIndexField[key] ?? key, so the identity entry was a no-op.Test plan
pnpm turbo typecheckclean across all five packagespnpm turbo test— server 1682 passed / 2 skipped, shared 97 passed0052_next_eternals.sqlis byte-identical to the0044this branch originally carriedaudience_rating > 7, re-scan and confirm the values survivecountryandcritic_rating🤖 Generated with Claude Code