[PR #15455] Add FTS5 full-text search support for BaseItems #14314

Open
opened 2026-02-07 07:27:49 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/15455
Author: @TOomaAh
Created: 11/10/2025
Status: 🔄 Open

Base: masterHead: feature/full-text-search


📝 Commits (7)

  • 87a7796 Add FTS5 full-text search support for BaseItems
  • 8ae6c95 feat: agnostic database
  • ee9eccd refactor: remove take
  • 500442f refactor: use Join
  • 522aaa3 reorder column + replace JOIN by IN
  • 1370ce3 fix comments
  • bb14f67 refactor: isolate provider-specific entities from base DbContext

📊 Changes

19 files changed (+4183 additions, -1736 deletions)

View changed files

📝 Jellyfin.Server.Implementations/Extensions/ServiceCollectionExtensions.cs (+13 -2)
📝 Jellyfin.Server.Implementations/Item/BaseItemRepository.cs (+19 -7)
📝 Jellyfin.Server/Program.cs (+3 -0)
src/Jellyfin.Database/Jellyfin.Database.Implementations/Extensions/FullTextSearchExtensions.cs (+166 -0)
src/Jellyfin.Database/Jellyfin.Database.Implementations/FtsSearchOptions.cs (+30 -0)
src/Jellyfin.Database/Jellyfin.Database.Implementations/IFullTextSearchProvider.cs (+26 -0)
📝 src/Jellyfin.Database/Jellyfin.Database.Implementations/IJellyfinDatabaseProvider.cs (+27 -0)
📝 src/Jellyfin.Database/Jellyfin.Database.Implementations/JellyfinDbContext.cs (+8 -3)
src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Entities/BaseItemFtsEntity.cs (+46 -0)
src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Extensions/Fts5QueryBuilder.cs (+71 -0)
src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Extensions/SqliteFtsDbFunctions.cs (+13 -0)
src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/20251108202033_AddFullTextSearchIndexes.Designer.cs (+1721 -0)
src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/20251108202033_AddFullTextSearchIndexes.cs (+76 -0)
📝 src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/JellyfinDbModelSnapshot.cs (+1757 -1718)
📝 src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/SqliteDesignTimeJellyfinDbFactory.cs (+5 -5)
src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/ModelConfiguration/BaseItemFtsEntityConfiguration.cs (+30 -0)
📝 src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/SqliteDatabaseProvider.cs (+47 -1)
src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/SqliteFtsProvider.cs (+88 -0)
src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/SqliteJellyfinDbContext.cs (+37 -0)

📄 Description

Changes
Implements SQLite FTS5 virtual table to improve search performance on large media libraries. Uses pure LINQ queries via BaseItemFtsEntity with the Match column approach. Includes migration with automatic sync triggers for INSERT/UPDATE/DELETE operations. Configures Porter stemming tokenizer with prefix matching for more flexible search results.

Current implementation:

image

With FTS5:

image

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jellyfin/jellyfin/pull/15455 **Author:** [@TOomaAh](https://github.com/TOomaAh) **Created:** 11/10/2025 **Status:** 🔄 Open **Base:** `master` ← **Head:** `feature/full-text-search` --- ### 📝 Commits (7) - [`87a7796`](https://github.com/jellyfin/jellyfin/commit/87a779662f07d81cefeb00a5d3cfefc2d79994e5) Add FTS5 full-text search support for BaseItems - [`8ae6c95`](https://github.com/jellyfin/jellyfin/commit/8ae6c95509f3d8316dc1468c0f160a6f65a9b6a9) feat: agnostic database - [`ee9eccd`](https://github.com/jellyfin/jellyfin/commit/ee9eccd2833f64561614201d92b4ae492f01024b) refactor: remove take - [`500442f`](https://github.com/jellyfin/jellyfin/commit/500442f00daea5b26e236eab36a3c632c6aff79f) refactor: use Join - [`522aaa3`](https://github.com/jellyfin/jellyfin/commit/522aaa31b603ba6aef6dbcb04d125ddba6f3f7d4) reorder column + replace JOIN by IN - [`1370ce3`](https://github.com/jellyfin/jellyfin/commit/1370ce3d47fc0da7d17d463ec69ef2778bdc6ac4) fix comments - [`bb14f67`](https://github.com/jellyfin/jellyfin/commit/bb14f677da185fe2b30cdad3e5186ee574eb41d0) refactor: isolate provider-specific entities from base DbContext ### 📊 Changes **19 files changed** (+4183 additions, -1736 deletions) <details> <summary>View changed files</summary> 📝 `Jellyfin.Server.Implementations/Extensions/ServiceCollectionExtensions.cs` (+13 -2) 📝 `Jellyfin.Server.Implementations/Item/BaseItemRepository.cs` (+19 -7) 📝 `Jellyfin.Server/Program.cs` (+3 -0) ➕ `src/Jellyfin.Database/Jellyfin.Database.Implementations/Extensions/FullTextSearchExtensions.cs` (+166 -0) ➕ `src/Jellyfin.Database/Jellyfin.Database.Implementations/FtsSearchOptions.cs` (+30 -0) ➕ `src/Jellyfin.Database/Jellyfin.Database.Implementations/IFullTextSearchProvider.cs` (+26 -0) 📝 `src/Jellyfin.Database/Jellyfin.Database.Implementations/IJellyfinDatabaseProvider.cs` (+27 -0) 📝 `src/Jellyfin.Database/Jellyfin.Database.Implementations/JellyfinDbContext.cs` (+8 -3) ➕ `src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Entities/BaseItemFtsEntity.cs` (+46 -0) ➕ `src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Extensions/Fts5QueryBuilder.cs` (+71 -0) ➕ `src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Extensions/SqliteFtsDbFunctions.cs` (+13 -0) ➕ `src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/20251108202033_AddFullTextSearchIndexes.Designer.cs` (+1721 -0) ➕ `src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/20251108202033_AddFullTextSearchIndexes.cs` (+76 -0) 📝 `src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/JellyfinDbModelSnapshot.cs` (+1757 -1718) 📝 `src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/SqliteDesignTimeJellyfinDbFactory.cs` (+5 -5) ➕ `src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/ModelConfiguration/BaseItemFtsEntityConfiguration.cs` (+30 -0) 📝 `src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/SqliteDatabaseProvider.cs` (+47 -1) ➕ `src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/SqliteFtsProvider.cs` (+88 -0) ➕ `src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/SqliteJellyfinDbContext.cs` (+37 -0) </details> ### 📄 Description **Changes** Implements SQLite FTS5 virtual table to improve search performance on large media libraries. Uses pure LINQ queries via BaseItemFtsEntity with the Match column approach. Includes migration with automatic sync triggers for INSERT/UPDATE/DELETE operations. Configures Porter stemming tokenizer with prefix matching for more flexible search results. Current implementation: <img width="1926" height="1228" alt="image" src="https://github.com/user-attachments/assets/f814f104-a9cc-412d-83d2-479d6446c2ae" /> With FTS5: <img width="1939" height="1230" alt="image" src="https://github.com/user-attachments/assets/fbddb397-dbc9-4e82-8e87-cc87ae9931c2" /> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-07 07:27:49 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#14314