title: Sitecore Refresh Index
body: <p>I am working on Sitecore 7.2 and using Lucene search, I have created few templates and pages and search is working fine, now I want to exclude few templates from the index, I have a custom crawler and that does remove the templates from indexes but  index is not refreshed, I am using following code to update index</p>
  
  <pre class="lang-cs prettyprint-override"><code>foreach (Cache cache in CacheManager.GetAllCaches())
  {
      //WriteLog(string.Concat(" Clearing Cache, name = ", cache.Name));
      cache.Clear();
  }
  //WriteLog("Clearing caching finished");
  var index = ContentSearchManager.GetIndex("sitecore_global_index");
  index.RebuildAsync(IndexingOptions.ForcedIndexing, new System.Threading.CancellationToken(false));
  index.Reset();
  //index.Refresh();
  </code></pre>