Skip to content

Commit

Permalink
Merge pull request #4448 from sbwalker/dev
Browse files Browse the repository at this point in the history
change Ignore Paths to Ignore Pages
  • Loading branch information
sbwalker authored Jul 21, 2024
2 parents 4462ae9 + ef272dd commit 116a615
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions Oqtane.Client/Modules/Admin/Search/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down Expand Up @@ -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;
Expand All @@ -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", "");
Expand All @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions Oqtane.Client/Resources/Modules/Admin/Search/Index.resx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
6 changes: 3 additions & 3 deletions Oqtane.Server/Infrastructure/Jobs/SearchIndexJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class SearchIndexJob : HostedServiceBase
{
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)
Expand Down Expand Up @@ -59,7 +59,7 @@ public override async Task<string> ExecuteJobAsync(IServiceProvider provider)
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);
Expand All @@ -69,7 +69,7 @@ public override async Task<string> ExecuteJobAsync(IServiceProvider provider)
// 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;
}
Expand Down

0 comments on commit 116a615

Please sign in to comment.