【发布时间】:2018-07-27 14:26:03
【问题描述】:
是否可以强制停止 MarkLogic 数据库中正在进行的重新索引?如果是,怎么做?
【问题讨论】:
标签: marklogic marklogic-8
是否可以强制停止 MarkLogic 数据库中正在进行的重新索引?如果是,怎么做?
【问题讨论】:
标签: marklogic marklogic-8
您可以禁用重新索引,但值得考虑这样做是为了解决什么问题。仅当您更改索引设置时才会重新编制索引,并且大概如果您更改索引设置,您会希望新设置生效。如果您经常更改索引设置并希望控制重新索引的资源量,您也可以限制。
要禁用重新索引,请查看此处:http://docs.marklogic.com/guide/admin/databases#id_28645
【讨论】:
禁用重新索引的方法:
使用管理界面,您可以disable reindexing:
Databses -> select your content database false
ok按钮以编程方式,使用admin:database-set-reindexer-enable() 函数:
xquery version "1.0-ml";
import module namespace admin = "http://marklogic.com/xdmp/admin"
at "/MarkLogic/admin.xqy";
let $config := admin:get-configuration()
let $disabled-reindexer-config := admin:database-set-reindexer-enable($config,
xdmp:database("myDatabase"), fn:false())
(: returns the new configuration element -- use admin:save-configuration
to save the changes to the configuration or pass the configuration
to other Admin API functions to make other changes. :)
return
admin:save-configuration( $disabled-reindexer-config )
除了禁用重新索引之外,您还可以通过管理 UI 或使用 admin:database-set-reindexer-throttle() 调整限制级别,以最大限度地减少对性能的影响。
https://developer.marklogic.com/blog/mitigating-the-impact-of-re-indexing
【讨论】: