mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-11-15 18:08:53 -07:00
Merge pull request #8914 from bradbeattie/augmented-tag-searching
Augment tag searching to consider individual ItemValues instead of the delimited tags field
This commit is contained in:
commit
10fde0a2c1
@ -2452,7 +2452,9 @@ namespace Emby.Server.Implementations.Data
|
|||||||
if (query.SearchTerm.Length > 1)
|
if (query.SearchTerm.Length > 1)
|
||||||
{
|
{
|
||||||
builder.Append("+ ((CleanName like @SearchTermContains or (OriginalTitle not null and OriginalTitle like @SearchTermContains)) * 10)");
|
builder.Append("+ ((CleanName like @SearchTermContains or (OriginalTitle not null and OriginalTitle like @SearchTermContains)) * 10)");
|
||||||
builder.Append("+ ((Tags not null and Tags like @SearchTermContains) * 5)");
|
builder.Append("+ (SELECT COUNT(1) * 1 from ItemValues where ItemId=Guid and CleanValue like @SearchTermContains)");
|
||||||
|
builder.Append("+ (SELECT COUNT(1) * 2 from ItemValues where ItemId=Guid and CleanValue like @SearchTermStartsWith)");
|
||||||
|
builder.Append("+ (SELECT COUNT(1) * 10 from ItemValues where ItemId=Guid and CleanValue like @SearchTermEquals)");
|
||||||
}
|
}
|
||||||
|
|
||||||
builder.Append(") as SearchScore");
|
builder.Append(") as SearchScore");
|
||||||
@ -2483,6 +2485,11 @@ namespace Emby.Server.Implementations.Data
|
|||||||
{
|
{
|
||||||
statement.TryBind("@SearchTermContains", "%" + searchTerm + "%");
|
statement.TryBind("@SearchTermContains", "%" + searchTerm + "%");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (commandText.Contains("@SearchTermEquals", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
statement.TryBind("@SearchTermEquals", searchTerm);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BindSimilarParams(InternalItemsQuery query, IStatement statement)
|
private void BindSimilarParams(InternalItemsQuery query, IStatement statement)
|
||||||
|
Loading…
Reference in New Issue
Block a user