示例#1
0
        internal static void IndexSite()
        {
            if (!_indexing)
            {
                _indexing = true;

                try {
                    TagManager.ClearCache();

                    if (_pageLanguageIndex != null)
                    {
                        _pageLanguageIndex.Clear();
                    }

                    _pageLanguageIndex = new List <PageIndex>();

                    var languages = Language.Languages;

                    foreach (var language in languages)
                    {
                        IndexSite(language.LanguageId);
                    }
                }
                catch (Exception e) {
                    Logger.Write("Indexing failed!! " + e.Message, Logger.Severity.Critical);
                    throw;
                }
                finally {
                    _indexing = false;
                }
            }
            else
            {
                HttpContext.Current.Response.Clear();
                Utils.RenderSimplePage(HttpContext.Current.Response, "Reindexing the site..", "Please check back in 10 seconds..");
            }
        }