diff options
| author | SteveTheGrey <118358130+SteveTheGrey@users.noreply.github.com> | 2022-11-27 16:03:28 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-27 09:03:28 -0700 |
| commit | 87d4ef7403f6601151397da977f4e591524c1709 (patch) | |
| tree | bc83a2cdf54a7de1e3aa30e2bf1c813cb4694bcc /Emby.Server.Implementations/Data | |
| parent | 036382debbd61207799f17bffcd6379a4c1b3795 (diff) | |
Minor search update - full word titles matches first (#8757)
Diffstat (limited to 'Emby.Server.Implementations/Data')
| -rw-r--r-- | Emby.Server.Implementations/Data/SqliteItemRepository.cs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs index 371111dff..4f0a15df1 100644 --- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs +++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs @@ -2456,6 +2456,8 @@ namespace Emby.Server.Implementations.Data builder.Append('('); builder.Append("((CleanName like @SearchTermStartsWith or (OriginalTitle not null and OriginalTitle like @SearchTermStartsWith)) * 10)"); + builder.Append("+ ((CleanName = @SearchTermStartsWith COLLATE NOCASE or (OriginalTitle not null and OriginalTitle = @SearchTermStartsWith COLLATE NOCASE)) * 10)"); + if (query.SearchTerm.Length > 1) { @@ -3154,6 +3156,11 @@ namespace Emby.Server.Implementations.Data return ItemSortBy.SimilarityScore; } + if (string.Equals(name, ItemSortBy.SearchScore, StringComparison.OrdinalIgnoreCase)) + { + return ItemSortBy.SearchScore; + } + // Unknown SortBy, just sort by the SortName. return ItemSortBy.SortName; } |
