admin管理员组文章数量:1315809
Is it possible to call the clear and reindex programmatically in Optimizely 11? I want to create a job that will clear and reindex so it will part of the release process.
Is it possible to call the clear and reindex programmatically in Optimizely 11? I want to create a job that will clear and reindex so it will part of the release process.
https://support.optimizely/hc/en-us/articles/4413200747789-Clear-the-index-and-reindex
Share Improve this question edited Jan 30 at 6:07 DarkBee 15.6k8 gold badges72 silver badges117 bronze badges asked Jan 30 at 2:10 user3928241user3928241 1631 gold badge3 silver badges10 bronze badges 1- 1 What did they say when you asked them? – mjwills Commented Jan 30 at 2:55
1 Answer
Reset to default 1You would typically use the ContentIndexer.Instance
implementation.
To remove, use the ContentIndexer.Instance.RemoveFromIndex()
implementation
To clear the index I've done something like this
// 1 is root, adjust to your preference
var entryPoint = new ContentReference(1);
// Get all indexable languages from Find
var languages = SearchClient.Instance.Settings.Languages;
languages.ForEach(x => ContentIndexer.Instance.RemoveFromIndex(contentLink: entryPoint, cascade: true, language: x.FieldSuffix));
To reindex
ContentIndexer.Instance.IndexAll();
本文标签: cClear index and reindex programmaticallyStack Overflow
版权声明:本文标题:c# - Clear index and reindex programmatically - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741989284a2408873.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论