replace ZWNJ with space in search

This commit is contained in:
Hamid Reza Mohammadi 2021-05-15 15:14:36 +04:30
parent de861ccd88
commit 2c900f711f
2 changed files with 6 additions and 1 deletions

View File

@ -111,6 +111,7 @@ namespace GanjooRazor.Pages
LoggedIn = !string.IsNullOrEmpty(Request.Cookies["Token"]);
Query = Request.Query["s"].ApplyCorrectYeKe().Trim();
Query = Query.Replace('‌', ' '); //replace zwnj with space
PoetId = string.IsNullOrEmpty(Request.Query["author"]) ? 0 : int.Parse(Request.Query["author"]);
CatId = string.IsNullOrEmpty(Request.Query["cat"]) ? 0 : int.Parse(Request.Query["cat"]);

View File

@ -1879,6 +1879,10 @@ namespace RMuseum.Services.Implementation
{
return new RServiceResult<(PaginationMetadata PagingMeta, GanjoorPoemCompleteViewModel[] Items)>((null, null), "خطای جستجوی عبارت خالی");
}
term = term.Replace("‌", " ");//replace zwnj with space
string searchConditions;
if(term.IndexOf('"') == 0 && term.LastIndexOf('"') == (term.Length - 1))
{
@ -2060,7 +2064,7 @@ namespace RMuseum.Services.Implementation
string plainText = "";
foreach (GanjoorVerse verse in verses)
{
plainText += $"{verse.Text} ";
plainText += $"{verse.Text.Replace("‌", " ")} ";//replace zwnj with space
}
dbPoem.PlainText = plainText.Trim();