Index Settings

Index Settings

Controls featured in this example:

  • Sitecore Web Control

Classes featured in this example:

  • Sitecore.Configuration.Settings.Indexing
  • Sitecore.Context
  • Sitecore.Data.Items.Item

Index Settings C# Web Control Code

Sitecore.Data.Items.Item item = Sitecore.Context.Item;
if (item == null) return;

output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Style, "font-weight:bold; width:100%; clear:both");
output.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.Div);
output.Write("C# Web Control Real-time Output");
output.RenderEndTag();

output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Style, "font-size:x-small; width:100%; clear:both");
output.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.Div);
output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Style, "font-weight:bold");
output.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.P);
//using : for colon and   for space
output.Write("{0}: {1}", "Item", item.DisplayName);
output.RenderEndTag(); //P

string indexFolder = Sitecore.Configuration.Settings.IndexFolder;
string indexingEnabled = Sitecore.Configuration.Settings.Indexing.Enabled.ToString();
string serverSpecificProperties = Sitecore.Configuration.Settings.Indexing.ServerSpecificProperties.ToString();
string updateInterval = Sitecore.Configuration.Settings.Indexing.UpdateInterval.ToString();
string updateJobThrottle = Sitecore.Configuration.Settings.Indexing.UpdateJobThrottle.ToString();

//using : for colon and   for space
output.Write("{0}&#58;&#160;{1}", "Index Folder", "<b>" + indexFolder + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Indexing Enabled", "<b>" + indexingEnabled + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Server Specific Properties", "<b>" + serverSpecificProperties + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Update Interval", "<b>" + updateInterval + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Update Job Throttle", "<b>" + updateJobThrottle + "</b>");
output.RenderEndTag(); //Div


Index Settings C# Web Control Output

Index Folder: C:\Inetpub\wwwroot\TIC66Live\Data\/indexes
Indexing Enabled: True
Server Specific Properties: False
Update Interval: 00:05:00
Update Job Throttle: 00:00:01