Skip to content
This repository was archived by the owner on Feb 15, 2026. It is now read-only.

feat(search.ts): improve search ranking by incorporating popularity score#4312

Open
GruperTal wants to merge 1 commit intosct:developfrom
GruperTal:feat/improve-search-ranking-with-popularity
Open

feat(search.ts): improve search ranking by incorporating popularity score#4312
GruperTal wants to merge 1 commit intosct:developfrom
GruperTal:feat/improve-search-ranking-with-popularity

Conversation

@GruperTal
Copy link

@GruperTal GruperTal commented Dec 22, 2025

Description

Improves search result ranking by incorporating TMDB popularity scores into the sorting algorithm. Previously, search results were returned in TMDB's default order which prioritizes text matching over popularity, causing obscure titles to appear above well-known ones.

Problem
When searching for partial titles (e.g., "the hunger"), less popular movies with closer text matches would appear before highly popular titles like "The Hunger Games" franchise.

Solution
Implemented a scoring system that combines:
Popularity (primary factor) - TMDB popularity score weighted heavily
Text relevance (secondary factor) - small boosts for titles starting with or exactly matching the query
This ensures popular titles rank appropriately while still giving slight preference to closer text matches when popularity is similar.

Changes
Added calculateSearchScore() function that computes a weighted score
Added sortResultsByRelevanceAndPopularity() to sort results by combined score
Applied sorting to all search results including special search providers (year:, tmdb:, etc.)

Testing
Tested with queries like "the hunger" - The Hunger Games movies now appear before obscure titles like "The Hunger".

To-Dos

  • Successful build yarn build

even when less popular titles have closer text matches.mprove search ranking by incorporating
popularity score
@GruperTal GruperTal changed the title feat(search.ts): mprove search ranking by incorporating popularity score feat(search.ts): improve search ranking by incorporating popularity score Dec 22, 2025
@fallenbagel
Copy link
Contributor

fallenbagel commented Feb 9, 2026

This is a good QOL feature, imho. Please redirect your PR towards https://github.com/seerr-team/seerr as this repo is no longer maintained (we will archive this repo soon).

@GruperTal

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants