breaking search modifications into smaller PRs
This commit is contained in:
@ -95,19 +95,15 @@ namespace Oqtane.Managers.Search
|
||||
searchContent.EntityName = EntityNames.Module;
|
||||
}
|
||||
|
||||
if(searchContent.EntityId == 0)
|
||||
if(string.IsNullOrEmpty(searchContent.EntityId))
|
||||
{
|
||||
searchContent.EntityId = pageModule.ModuleId;
|
||||
searchContent.EntityId = pageModule.ModuleId.ToString();
|
||||
}
|
||||
|
||||
if (searchContent.IsActive)
|
||||
{
|
||||
searchContent.IsActive = !pageModule.Module.IsDeleted;
|
||||
}
|
||||
|
||||
if (searchContent.ModifiedTime == DateTime.MinValue)
|
||||
if (searchContent.ContentModifiedOn == DateTime.MinValue)
|
||||
{
|
||||
searchContent.ModifiedTime = pageModule.ModifiedOn;
|
||||
searchContent.ContentModifiedOn = pageModule.ModifiedOn;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(searchContent.AdditionalContent))
|
||||
|
@ -48,16 +48,18 @@ namespace Oqtane.Managers.Search
|
||||
|
||||
var searchContent = new SearchContent
|
||||
{
|
||||
EntityName = EntityNames.Page,
|
||||
EntityId = page.PageId,
|
||||
SiteId = page.SiteId,
|
||||
ModifiedTime = page.ModifiedOn,
|
||||
AdditionalContent = string.Empty,
|
||||
Url = $"{(!string.IsNullOrEmpty(page.Path) && !page.Path.StartsWith("/") ? "/" : "")}{page.Path}",
|
||||
EntityName = EntityNames.Page,
|
||||
EntityId = page.PageId.ToString(),
|
||||
Title = !string.IsNullOrEmpty(page.Title) ? page.Title : page.Name,
|
||||
Description = string.Empty,
|
||||
Body = $"{page.Name} {page.Title}",
|
||||
IsActive = !page.IsDeleted && Utilities.IsPageModuleVisible(page.EffectiveDate, page.ExpiryDate)
|
||||
Url = $"{(!string.IsNullOrEmpty(page.Path) && !page.Path.StartsWith("/") ? "/" : "")}{page.Path}",
|
||||
Permissions = $"{EntityNames.Page}:{page.PageId}",
|
||||
ContentModifiedBy = page.ModifiedBy,
|
||||
ContentModifiedOn = page.ModifiedOn,
|
||||
AdditionalContent = string.Empty,
|
||||
CreatedOn = DateTime.UtcNow
|
||||
};
|
||||
|
||||
if (searchContent.SearchContentProperties == null)
|
||||
|
Reference in New Issue
Block a user