Skip to content

Instantly share code, notes, and snippets.

@rangler2
rangler2 / rebuild.aspx
Last active June 17, 2022 11:51
Simple aspx script to view or rebuild examine indexes for Umbraco 7 on Azure web app multiple instances autoscaled. Supporting blog post with screenshot - http://andrew.lansdowne.me/2022/06/17/how-to-check-and-rebuild-on-each-node-of-an-umbraco-azure-autoscaled-web-app/
<%@ Page language="c#" %>
<script runat="server" language="c#">
protected void Rebuild(object sender, System.EventArgs e){
if (machineName.Text == Environment.MachineName) {
var index = Examine.ExamineManager.Instance.IndexProviderCollection[indexName.Text];
if (index != null) {
index.RebuildIndex();
Response.Write("<h1>Triggered rebuild of " + index.Name + " on " + Environment.MachineName + "</h1>");
} else {