Skip to content

Instantly share code, notes, and snippets.

@abjerner
Created December 15, 2015 08:38
Show Gist options
  • Save abjerner/da14eaaace6a33da9fec to your computer and use it in GitHub Desktop.
Save abjerner/da14eaaace6a33da9fec to your computer and use it in GitHub Desktop.
Index a single content node in Examine
@using System.Xml.Linq
@using umbraco.cms.businesslogic.web
@using UmbracoExamine
@inherits UmbracoViewPage
@{
// Generate an instance of XElement to be indexed
XElement node = new Document(Model.Id).ToXDocument(false).Root;
// Index the element in Examine
ExamineManager.Instance.IndexProviderCollection["ExternalIndexer"].ReIndexNode(node, IndexTypes.Content);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment