change Ignore Paths to Ignore Pages

This commit is contained in:
sbwalker 2024-07-21 09:10:01 -04:00
parent 66ffad0b4e
commit ef272dd6a8
3 changed files with 12 additions and 12 deletions

View File

@ -27,9 +27,9 @@
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="ignorepaths" HelpText="Comma delimited list of page paths which should be ignored" ResourceKey="IgnorePaths">Ignore Paths: </Label>
<Label Class="col-sm-3" For="ignorepages" HelpText="Comma delimited list of pages which should be ignored (based on their path)" ResourceKey="IgnorePages">Ignore Pages: </Label>
<div class="col-sm-9">
<textarea id="ignorepaths" class="form-control" @bind="@_ignorePaths" rows="3"></textarea>
<textarea id="ignorepages" class="form-control" @bind="@_ignorePages" rows="3"></textarea>
</div>
</div>
<div class="row mb-1 align-items-center">
@ -61,7 +61,7 @@
private string _searchProvider;
private string _enabled;
private string _lastIndexedOn;
private string _ignorePaths;
private string _ignorePages;
private string _ignoreEntities;
private string _minimumWordLength;
private string _ignoreWords;
@ -72,7 +72,7 @@
_searchProvider = SettingService.GetSetting(settings, "Search_SearchProvider", Constants.DefaultSearchProviderName);
_enabled = SettingService.GetSetting(settings, "Search_Enabled", "True");
_lastIndexedOn = SettingService.GetSetting(settings, "Search_LastIndexedOn", "");
_ignorePaths = SettingService.GetSetting(settings, "Search_IgnorePaths", "");
_ignorePages = SettingService.GetSetting(settings, "Search_IgnorePages", "");
_ignoreEntities = SettingService.GetSetting(settings, "Search_IgnoreEntities", "");
_minimumWordLength = SettingService.GetSetting(settings, "Search_MininumWordLength", "3");
_ignoreWords = SettingService.GetSetting(settings, "Search_IgnoreWords", "");
@ -86,7 +86,7 @@
settings = SettingService.SetSetting(settings, "Search_SearchProvider", _searchProvider);
settings = SettingService.SetSetting(settings, "Search_Enabled", _enabled, true);
settings = SettingService.SetSetting(settings, "Search_LastIndexedOn", _lastIndexedOn, true);
settings = SettingService.SetSetting(settings, "Search_IgnorePaths", _ignorePaths, true);
settings = SettingService.SetSetting(settings, "Search_IgnorePages", _ignorePages, true);
settings = SettingService.SetSetting(settings, "Search_IgnoreEntities", _ignoreEntities, true);
settings = SettingService.SetSetting(settings, "Search_MininumWordLength", _minimumWordLength, true);
settings = SettingService.SetSetting(settings, "Search_IgnoreWords", _ignoreWords, true);

View File

@ -129,11 +129,11 @@
<data name="LastIndexedOn.HelpText" xml:space="preserve">
<value>The date/time which the site was last indexed on</value>
</data>
<data name="IgnorePaths.Text" xml:space="preserve">
<value>Ignore Paths: </value>
<data name="IgnorePages.Text" xml:space="preserve">
<value>Ignore Pages: </value>
</data>
<data name="IgnorePaths.HelpText" xml:space="preserve">
<value>Comma delimited list of page paths which should be ignored</value>
<data name="IgnorePages.HelpText" xml:space="preserve">
<value>Comma delimited list of pages which should be ignored (based on page path)</value>
</data>
<data name="IgnoreEntities.Text" xml:space="preserve">
<value>Ignore Entities: </value>

View File

@ -16,7 +16,7 @@ namespace Oqtane.Infrastructure
{
private const string SearchLastIndexedOnSetting = "Search_LastIndexedOn";
private const string SearchEnabledSetting = "Search_Enabled";
private const string SearchIgnorePathsSetting = "Search_IgnorePaths";
private const string SearchIgnorePagesSetting = "Search_IgnorePages";
private const string SearchIgnoreEntitiesSetting = "Search_IgnoreEntities";
public SearchIndexJob(IServiceScopeFactory serviceScopeFactory) : base(serviceScopeFactory)
@ -59,7 +59,7 @@ namespace Oqtane.Infrastructure
var currentTime = DateTime.UtcNow;
var lastIndexedOn = Convert.ToDateTime(siteSettings.GetValue(SearchLastIndexedOnSetting, DateTime.MinValue.ToString()));
var ignorePaths = siteSettings.GetValue(SearchIgnorePathsSetting, "").Split(',');
var ignorePages = siteSettings.GetValue(SearchIgnorePagesSetting, "").Split(',');
var ignoreEntities = siteSettings.GetValue(SearchIgnoreEntitiesSetting, "").Split(',');
var pages = pageRepository.GetPages(site.SiteId);
@ -69,7 +69,7 @@ namespace Oqtane.Infrastructure
// index pages
foreach (var page in pages)
{
if (!string.IsNullOrEmpty(page.Path) && (Constants.InternalPagePaths.Contains(page.Path) || ignorePaths.Contains(page.Path)))
if (!string.IsNullOrEmpty(page.Path) && (Constants.InternalPagePaths.Contains(page.Path) || ignorePages.Contains(page.Path)))
{
continue;
}