Minor search update - full word titles matches first (#8757)
This commit is contained in:
parent
036382debb
commit
87d4ef7403
|
@ -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…
Reference in New Issue
Block a user