This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<configuration | |
xmlns:patch="http://www.sitecore.net/xmlconfig/" | |
xmlns:role="http://www.sitecore.net/xmlconfig/role/" | |
xmlns:search="http://www.sitecore.net/xmlconfig/search/"> | |
<sitecore role:require="Standalone or ContentManagement or ContentDelivery" search:require="solr"> | |
<contentSearch> | |
<indexConfigurations> | |
<blogPostSearchIndexConfiguration ref="contentSearch/indexConfigurations/defaultSolrIndexConfiguration"> | |
<fieldMap ref="contentSearch/indexConfigurations/defaultSolrIndexConfiguration/fieldMap"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<configuration | |
xmlns:patch="http://www.sitecore.net/xmlconfig/" | |
xmlns:role="http://www.sitecore.net/xmlconfig/role/" | |
xmlns:search="http://www.sitecore.net/xmlconfig/search/"> | |
<sitecore role:require="Standalone or ContentManagement or ContentDelivery" search:require="solr"> | |
<contentSearch> | |
<configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch"> | |
<indexes hint="list:AddIndex"> | |
<index id="sc93_blogs_index" type="Sitecore.ContentSearch.SolrProvider.SolrSearchIndex, Sitecore.ContentSearch.SolrProvider"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using Glass.Mapper.Sc.Web.Mvc | |
@using FluxDigital.Feature.Search.Models | |
@using PagedList.Mvc | |
@using Sitecore.Configuration | |
@model BlogPostSearchResultsModel | |
<div class="wrapper"> | |
<form class="search" action="" method="GET"> | |
<div class="search-box"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BlogPostSearchResultsController : SitecoreController | |
{ | |
private readonly ISearchService _blogPostSearchService; | |
public BlogPostSearchResultsController(ISearchService BlogPostSearchService) | |
{ | |
_blogPostSearchService = BlogPostSearchService; | |
} | |
public ActionResult Results() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BlogPostSearchIndexJob : IJob | |
{ | |
private readonly ISearchService _blogPostSearchService; | |
private readonly ILogService _logService; | |
public BlogPostSearchIndexJob() : | |
this(ServiceLocator.ServiceProvider.GetService<ISearchService>(), | |
ServiceLocator.ServiceProvider.GetService<ILogService>(), | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public BlogPostSearchResultsModel GetResults(BlogPostSearchResultsModel blogPostSearchResultsModel, string searchTerm, int resultsPerPage, int currentPage) | |
{ | |
using (new SecurityDisabler()) | |
{ | |
try | |
{ | |
var solrCharsToAllow = "()-+*./' "; | |
var solrCharsToEscape = "(,),||,!,[,],^,~,?,:,-,+,\""; //split on comma | |
var safeSearchTerm = searchTerm.Trim().RemoveSpecialCharacters(solrCharsToAllow); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public int IndexContent() | |
{ | |
var indexedCount = 0; | |
using (new SecurityDisabler()) | |
{ | |
try | |
{ | |
//get the blog posts from Sitecore | |
var blogPostsRootPath = _master.GetItem(Settings.GetSetting("BlogPostsRootPath")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Function used to find the CM Url | |
#> | |
function Get-CmUrl($item){ | |
$site = [Sitecore.Sites.SiteContext]::GetSite("website") | |
New-UsingBlock(New-Object -TypeName "Sitecore.Sites.SiteContextSwitcher" -ArgumentList $site) { | |
$urlOptions = [Sitecore.Links.LinkManager]::GetDefaultUrlOptions() | |
$urlOptions.AlwaysIncludeServerUrl = $True |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Function used to move preview site to the top of the list | |
#> | |
function Move-Preview-Site-To-Top($newSiteId){ | |
$sxaSitesList = Get-Item -Path "master:/sitecore/system/Settings/Foundation/Experience Accelerator/Multisite/Management/Sites" | |
$orderValuesCurrent = $sxaSitesList.Fields["Order"].Value; | |
write-host "New Site ID: $($newSiteId)" | |
write-host "Current Order Values: $($orderValuesCurrent)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
### Removes all existing SXA 'Draft' Sites ### | |
.Description | |
Finds all SXA Draft sites and deletes them. | |
#> | |
$sxaSites = Get-ChildItem -Path "/sitecore/content/Sites" | |
$successCount = 0 | |
$failCount = 0 | |
$siteGroupingPath = "Settings/Site Grouping" |