diff options
| author | Bond-009 <bond.009@outlook.com> | 2026-06-07 22:56:51 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-06-07 22:56:51 +0200 |
| commit | 4459147788c0a11d3039723644708f8c8f7cdf2d (patch) | |
| tree | 2d76561f3f60d62fb4ff1ebff3ee04ac97d35df6 /MediaBrowser.Controller/Library/ISearchManager.cs | |
| parent | 003f01a99aa7765c5380ff8cff0955addb72d083 (diff) | |
| parent | d8d386e88a8bd27ef8e40497e302db184cc02b08 (diff) | |
Merge pull request #16121 from Shadowghost/search-rebased
Implement search providers
Diffstat (limited to 'MediaBrowser.Controller/Library/ISearchManager.cs')
| -rw-r--r-- | MediaBrowser.Controller/Library/ISearchManager.cs | 48 |
1 files changed, 48 insertions, 0 deletions
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; + +/// <summary> +/// Orchestrates search operations across registered search providers. +/// </summary> +public interface ISearchManager +{ + /// <summary> + /// Searches for items and returns hints suitable for autocomplete/typeahead UI. + /// Results are ordered by relevance score from search providers. + /// </summary> + /// <param name="query">The search query including filters and pagination.</param> + /// <param name="cancellationToken">Cancellation token.</param> + /// <returns>Paginated search hints with item metadata for display.</returns> + Task<QueryResult<SearchHintInfo>> GetSearchHintsAsync( + SearchQuery query, + CancellationToken cancellationToken = default); + + /// <summary> + /// 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. + /// </summary> + /// <param name="query">The search provider query with type/media filters.</param> + /// <param name="cancellationToken">Cancellation token.</param> + /// <returns>Search results containing item IDs and relevance scores.</returns> + Task<IReadOnlyList<SearchResult>> GetSearchResultsAsync( + SearchProviderQuery query, + CancellationToken cancellationToken = default); + + /// <summary> + /// Registers search providers discovered through dependency injection. + /// Called during application startup. + /// </summary> + /// <param name="providers">The search providers to register.</param> + void AddParts(IEnumerable<ISearchProvider> providers); + + /// <summary> + /// Gets all registered search providers ordered by priority. + /// </summary> + /// <returns>The list of search providers including the SQL fallback provider.</returns> + IReadOnlyList<ISearchProvider> GetProviders(); +} |
