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 module ".\BlueGreenSolrSettings.psm1" | |
$ErrorActionPreference = "Stop" | |
<# | |
.SYNOPSIS | |
Pushes the specified config and related pieces to the SolrCloud Zookeepers. | |
.PARAMETER solrPath | |
Path on the machine to the Solr installation. | |
EX: C:\solr\solr-6.2.1 |
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 module ".\BlueGreenSolrSettings.psm1" | |
Set-StrictMode -Version 2.0 | |
$ErrorActionPreference = "Stop" | |
<# | |
.SYNOPSIS | |
Creates a BlueGreenSolrSettings object with property values defined by Octopus variables. | |
.PARAMETER Settings | |
An string dictionary passed in from Octopus deploy containing the variables used in | |
the defined deployment process. |
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
Set-StrictMode -Version 2.0 | |
$ErrorActionPreference = "Stop" | |
<# | |
.SYNOPSIS | |
Classes and properties utilized by the scripts to update SolrCloud in a blue/green environment | |
#> | |
class OctopusMachineSettings | |
{ |
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
$root = gi master:// -id "{0C3015B8-77AD-44DC-9633-2AD76489483A}" | |
$items = $root | ls -r | %{$item = $_; $_.Fields | ?{$_.TypeKey -eq "rich text"} } | |
#$items.Count | |
foreach($i in $items){ | |
if($temp){ | |
clear-variable("temp") | |
} | |
if($replaced){ | |
clear-variable("replaced") | |
} |
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
@model YOURNAMESPACE.ViewModels.Common.Components.Search.SearchResultsViewModel | |
<div class="container-fluid width-90"> | |
<div class="row"> | |
<h1>Search results for “@Model.SearchTerm”</h1> | |
@if (Model.SearchResults != null && Model.SearchResults.Any()) | |
{ | |
foreach (var result in Model.SearchResults) | |
{ |
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 System.Collections.Generic; | |
namespace YOURNAMESPACE.ViewModels.Common.Components.Search | |
{ | |
public class SearchResultsViewModel | |
{ | |
public string ViewPath { get { return Constants.Components.SearchResultsViewPath; } } | |
public IEnumerable<SiteSearchResult> SearchResults { get; set; } | |
public int TotalPageCount { get; set; } | |
public int TotalResults { get; set; } |
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 void Search(string term, string page) | |
{ | |
if (string.IsNullOrEmpty(term)) | |
{ | |
ViewModel.SearchTerm = "No search term entered"; | |
return; | |
} | |
ViewModel.SearchTerm = term; | |
var sitecoreService = new SitecoreService(Sitecore.Context.Database); |
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 Sitecore.ContentSearch; | |
using Sitecore.ContentSearch.SearchTypes; | |
namespace YOURNAMESPACE.ConcreteModels | |
{ | |
public class PageBaseSearchResult : SearchResultItem | |
{ | |
[IndexField("pagecontentfield")] | |
public string PageContentField{ get; set; } | |
} |
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
namespace YOURNAMESPACE.Search | |
{ | |
public class SiteSearchResult | |
{ | |
public string Title { get;set; } | |
public string PageLinkUrl { get; set; } | |
public string Content { get; set; } | |
} | |
} |