在后台进程中重建 Sitecore 搜索索引和链接数据库
我们有一个包含 1 个 CMS 和 3 个从属服务器的分阶段环境,
我想在从属服务器上创建一个页面,成功发布后分阶段模块将调用该页面,这将重建所有索引和链接数据库。
我知道我可以使用:
Globals.LinkDatabase.Rebuild(Factory.GetDatabase("web"));
重建链接数据库。
如何在可以访问 sitecore 上下文的单独进程中获取上述代码,以及如何重建 Web 数据库的所有索引 - 再次在单独的后台线程中。
谢谢
We have a staged environment with 1 CMS and 3 Slave servers
I want to create a page on the slave server, which will be called by the staging module on a successful publish, that will rebuild all indexes and the links database.
I know I can use:
Globals.LinkDatabase.Rebuild(Factory.GetDatabase("web"));
to rebuild the link database.
How do I get the above code in a separate process that has access to the sitecore context and also how do I rebuild all the indexes for the web database - again in a separate background thread.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我之前在使用 Sitecore 时遇到过这个问题,并采取了稍微不同的方法。 我没有使用暂存模块调用的页面,而是点击了发布:结束事件并添加了自定义处理程序来重建链接数据库。
I've come across this issue before with Sitecore and took a slightly different approch. Instead of having a page that the staging module calls I tapped into the publish:end event and added a custom handler to rebuild the Link Database.