Minor search update - full word titles matches first (#8757)

pull/8808/head
SteveTheGrey 2 years ago committed by GitHub
parent 036382debb
commit 87d4ef7403
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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;
}

@ -154,5 +154,10 @@ namespace MediaBrowser.Model.Querying
/// The similarity score.
/// </summary>
public const string SimilarityScore = "SimilarityScore";
/// <summary>
/// The search score.
/// </summary>
public const string SearchScore = "SearchScore";
}
}

Loading…
Cancel
Save