🐛 Fix query without vector failed in post
This commit is contained in:
@@ -94,9 +94,9 @@ public class PostController(
|
|||||||
query = query.Where(p => p.SearchVector.Matches(EF.Functions.ToTsQuery(queryTerm)));
|
query = query.Where(p => p.SearchVector.Matches(EF.Functions.ToTsQuery(queryTerm)));
|
||||||
else
|
else
|
||||||
query = query.Where(p =>
|
query = query.Where(p =>
|
||||||
(p.Title != null && EF.Functions.ILike(p.Title, $"%{query}%")) ||
|
(p.Title != null && EF.Functions.ILike(p.Title, $"%{queryTerm}%")) ||
|
||||||
(p.Description != null && EF.Functions.ILike(p.Description, $"%{query}%")) ||
|
(p.Description != null && EF.Functions.ILike(p.Description, $"%{queryTerm}%")) ||
|
||||||
(p.Content != null && EF.Functions.ILike(p.Content, $"%{query}%"))
|
(p.Content != null && EF.Functions.ILike(p.Content, $"%{queryTerm}%"))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user