gpt4 book ai didi

indexing - Sitecore 刷新索引

转载 作者:行者123 更新时间:2023-12-02 21:37:47 25 4
gpt4 key购买 nike

我正在使用 Sitecore 7.2 并使用 Lucene 搜索,我创建了一些模板和页面,搜索工作正常,现在我想从索引中排除一些模板,我有一个自定义爬虫,它确实从索引但索引未刷新,我使用以下代码来更新索引

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();

最佳答案

以下代码之前对我有用,它将索引从 RootItemInTree 及以下开始的内容树:

index.Refresh(new SitecoreIndexableItem(RootItemInTree));

关于indexing - Sitecore 刷新索引,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31419638/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com