This file contains 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
var page = new WebPage(), testindex = 0, loadInProgress = false; | |
var args = require('system').args; | |
var host = args[1]; | |
var username = args[2]; | |
var password = args[3]; | |
var pageEditorUrl = args[4]; | |
var token; | |
var system = require('system'); | |
phantom.cookiesEnabled = true; | |
phantom.javascriptEnabled = true; |
This file contains 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
// This code was used in a one-time migration script on Sitecore 7.2 (2014) | |
// Parts are supplied by Sitecore.Support. No guarantees ;) | |
// More context can be found here http://www.geekcore.nl/sitecore/extreme-sitecore-migration/ | |
public class TransferMedia | |
{ | |
public Sitecore.Data.Database migration | |
{ | |
get | |
{ |
This file contains 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
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> | |
<sitecore> | |
<contentSearch> | |
<indexConfigurations> | |
<!-- If no configuration is specified for an index, it uses the default configuration. The configurations are not merged if the index also has a | |
configuration. The system uses either the default configuration or the index configuration. --> | |
<CustomIndexBaseConfiguration type="Sitecore.ContentSearch.LuceneProvider.LuceneIndexConfiguration, Sitecore.ContentSearch.LuceneProvider"> | |
<!-- This flag will index all fields by default. This allows new fields in your templates to automatically be included into the index. | |
You have two choices : |
This file contains 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
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> | |
<sitecore> | |
<contentSearch> | |
<configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch"> | |
<indexes hint="list:AddIndex"> | |
<index id="yourcustom_indexname" type="Sitecore.ContentSearch.LuceneProvider.LuceneIndex, Sitecore.ContentSearch.LuceneProvider"> | |
<param desc="name">$(id)</param> | |
<param desc="folder">$(id)</param> | |
<!-- This initializes index property store. Id has to be set to the index id --> | |
<param desc="propertyStore" ref="contentSearch/indexConfigurations/databasePropertyStore" param1="$(id)" /> |
This file contains 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
/// <summary> | |
/// Get Searchresults with keyword overload for Global Search | |
/// </summary> | |
/// <typeparam name="U"></typeparam> | |
/// <param name="context"></param> | |
/// <param name="language"></param> | |
/// <param name="filters"></param> | |
/// <param name="unfilteredFacets"></param> | |
/// <param name="applyFacets"></param> | |
/// <param name="keyword"></param> |
This file contains 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
/// <summary> | |
/// Create an IIS binding. Warning: Sitecore will pickup the IIS | |
/// change and will restart when this code is executed! | |
/// </summary> | |
/// <returns></returns> | |
public void CreateIISBinding() | |
{ | |
ServerManager iisManager = new ServerManager(); | |
Site site = iisManager.Sites[Properties.Settings.Default.IISInstanceName]; | |
string binding = string.Format(@"{0}:{1}:{2}", "*", "80", this.HostName); |
This file contains 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
/// <summary> | |
/// Use Sitecore Content Search (Lucene) Index to retrieve all items from index that include a specific rendering | |
/// </summary> | |
/// <param name="templateID"></param> | |
/// <param name="database"></param> | |
/// <param name="indexName"></param> | |
/// <returns></returns> | |
private List<Item> GetAllItemsBasedOnRendering(ID renderingID, string database, string indexName) | |
{ | |
List<Item> resultList = new List<Item>(); |
This file contains 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
/// <summary> | |
/// Uses Lucene Contrib Highlighter to create search highlight based on an index field/string with all content | |
/// This code requires Lucene 3.0.3.0 DLL from Nuget and is not supported with the Sitecore7 Lucene DLL out of the box. | |
/// This is pure Lucene code and does not use any Sitecore namespaces. | |
/// Adding Try/catch is advised. searchQuery = searchterm/keyword(s) | |
/// </summary> | |
private string GenerateHighlightText(string pageContent, string searchQuery) | |
{ | |
var analyzer = new StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_30); | |
// Create Wildcard query using the BooleanQuery for multiple words. |