From 07a802d8fa93460c9f2a7f42da7a1f14a893a322 Mon Sep 17 00:00:00 2001 From: Shadowghost Date: Sun, 3 May 2026 23:33:56 +0200 Subject: Implement search providers --- MediaBrowser.Controller/Library/ISearchManager.cs | 48 +++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 MediaBrowser.Controller/Library/ISearchManager.cs (limited to 'MediaBrowser.Controller/Library/ISearchManager.cs') diff --git a/MediaBrowser.Controller/Library/ISearchManager.cs b/MediaBrowser.Controller/Library/ISearchManager.cs new file mode 100644 index 0000000000..4f763829a7 --- /dev/null +++ b/MediaBrowser.Controller/Library/ISearchManager.cs @@ -0,0 +1,48 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using MediaBrowser.Model.Querying; +using MediaBrowser.Model.Search; + +namespace MediaBrowser.Controller.Library; + +/// +/// Orchestrates search operations across registered search providers. +/// +public interface ISearchManager +{ + /// + /// Searches for items and returns hints suitable for autocomplete/typeahead UI. + /// Results are ordered by relevance score from search providers. + /// + /// The search query including filters and pagination. + /// Cancellation token. + /// Paginated search hints with item metadata for display. + Task> GetSearchHintsAsync( + SearchQuery query, + CancellationToken cancellationToken = default); + + /// + /// Gets ranked search results from registered providers. Returns only item IDs and + /// relevance scores; callers are responsible for loading items and applying user-access filtering. + /// + /// The search provider query with type/media filters. + /// Cancellation token. + /// Search results containing item IDs and relevance scores. + Task> GetSearchResultsAsync( + SearchProviderQuery query, + CancellationToken cancellationToken = default); + + /// + /// Registers search providers discovered through dependency injection. + /// Called during application startup. + /// + /// The search providers to register. + void AddParts(IEnumerable providers); + + /// + /// Gets all registered search providers ordered by priority. + /// + /// The list of search providers including the SQL fallback provider. + IReadOnlyList GetProviders(); +} -- cgit v1.2.3