Skip to content

Instantly share code, notes, and snippets.

Avatar

Martin English martinrayenglish

View GitHub Profile
@martinrayenglish
martinrayenglish / PowershellRedirectImport.ps1
Created Dec 11, 2016
Powershell script that targets a CSV file in the media library and creates simple redirect items for each data record
View PowershellRedirectImport.ps1
<#
.SYNOPSIS
Script targets a CSV file in the media library and creates simple redirect items for each data record
.NOTES
Martin English
#>
#Target csv file in media library
$media = "/sitecore/media library/import-data"
@martinrayenglish
martinrayenglish / Sitecore.AzureDev.IndexDefinitions.config
Last active May 10, 2018
Patch file to update Sitecore Index names to allow developers to share an Azure Search Service. Simply set the environment variable and drop this file in the "Include/zzz" folder
View Sitecore.AzureDev.IndexDefinitions.config
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/">
<sitecore>
<sc.variable name="environment" value="martin_dev_" />
<contentSearch>
<configuration>
<indexes>
<index id="sitecore_master_index" type="Sitecore.ContentSearch.Azure.CloudSearchProviderIndex, Sitecore.ContentSearch.Azure">
<param desc="name" patch:instead="param[@desc='name']">$(environment)$(id)</param>
</index>
<index id="sitecore_web_index" type="Sitecore.ContentSearch.Azure.CloudSearchProviderIndex, Sitecore.ContentSearch.Azure">
@martinrayenglish
martinrayenglish / CustomMongoDriverSettings.cs
Created Jul 8, 2018
Processor for updateMongoDriverSettings pipeline to alter MongoDB settings that are not available in the connection string
View CustomMongoDriverSettings.cs
using System;
using Sitecore.Analytics.Pipelines.UpdateMongoDriverSettings;
using Sitecore.Diagnostics;
namespace MySite.Foundation.SitecoreExtensions.Pipelines.UpdateMongoDriverSettings
{
public class CustomMongoDriverSettings : UpdateMongoDriverSettingsProcessor
{
private readonly string _maxConnectionPoolSize;
@martinrayenglish
martinrayenglish / Foundation.SitecoreExtensions.config
Created Jul 8, 2018
Patch to add custom processor to updateMongoDriverSettings pipeline
View Foundation.SitecoreExtensions.config
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<pipelines>
<updateMongoDriverSettings>
<processor type="MySite.Foundation.SitecoreExtensions.Pipelines.UpdateMongoDriverSettings.CustomMongoDriverSettings, MySite.Foundation.SitecoreExtensions">
<param desc="maxConnectionPoolSize">150</param>
<param desc="minConnectionPoolSize">20</param>
<param desc="maxConnectionIdleTimeSeconds">1500</param>
<param desc="maxConnectionLifeTimeSeconds">0</param>
</processor>
View RemoveBrokenLinks .cs
@martinrayenglish
martinrayenglish / Sitecore.Support.312397.sql
Created Aug 17, 2019
Stored Procedure performance issues related to SQL when querying the Sitecore Reference Data database - Sitecore.Support.312397
View Sitecore.Support.312397.sql
ALTER PROCEDURE [xdb_refdata].[DeleteDefinitions]
(
@Keys [xdb_refdata].[DefinitionKeys] READONLY
)
WITH EXECUTE AS OWNER
AS
BEGIN
SET NOCOUNT ON;
DECLARE
View Locations.Azure.IndexConfiguration.config
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/" xmlns:search="http://www.sitecore.net/xmlconfig/search/" xmlns:role="http://www.sitecore.net/xmlconfig/role/">
<sitecore role:require="Standalone or ContentDelivery or ContentManagement" search:require="azure">
<contentSearch>
<indexConfigurations>
<locationCloudIndexConfiguration ref="contentSearch/indexConfigurations/defaultCloudIndexConfiguration">
<documentOptions type="Sitecore.ContentSearch.DocumentBuilderOptions, Sitecore.ContentSearch">
<indexAllFields>false</indexAllFields>
<include hint="list:AddIncludedTemplate">
<locationTemplateId>{53720ED3-C9F1-494F-88D8-BF05609E79FB}</locationTemplateId>
View Locations.Azure.Index.Web.config
<?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 ContentDelivery or ContentManagement" search:require="azure">
<contentSearch>
<configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
<indexes hint="list:AddIndex">
<index id="test_locations_web_index" type="Sitecore.ContentSearch.Azure.CloudSearchProviderIndex, Sitecore.ContentSearch.Azure">
<param desc="name">$(id)</param>
<param desc="connectionStringName">cloud.search</param>
<param desc="totalParallelServices">5</param>
@martinrayenglish
martinrayenglish / Sitecore xDB.postman_collection.json
Created Jun 7, 2020
Solr xDB Index Troubleshooting Postman Collection
View Sitecore xDB.postman_collection.json
{
"info": {
"_postman_id": "ac487bbf-4bc0-498c-9b16-034706b6fc19",
"name": "Sitecore xDB",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "xDB Contacts Count",
"request": {
@martinrayenglish
martinrayenglish / CustomXConnectDataAdapterProvider.cs
Created Jun 21, 2020
Sitecore xConnect XConnectDataAdapterProvider extension to only goals and other events specified in configuration
View CustomXConnectDataAdapterProvider.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Xml;
using Sitecore.Analytics.Model;
using Sitecore.Analytics.XConnect.DataAccess;
using Sitecore.Framework.Conditions;
using Sitecore.Xml;