【问题标题】:How to force stop re-indexing in a MarkLogic database?如何强制停止在 MarkLogic 数据库中重新索引?
【发布时间】:2018-07-27 14:26:03
【问题描述】:

是否可以强制停止 MarkLogic 数据库中正在进行的重新索引?如果是,怎么做?

【问题讨论】:

    标签: marklogic marklogic-8


    【解决方案1】:

    您可以禁用重新索引,但值得考虑这样做是为了解决什么问题。仅当您更改索引设置时才会重新编制索引,并且大概如果您更改索引设置,您会希望新设置生效。如果您经常更改索引设置并希望控制重新索引的资源量,您也可以限制。

    要禁用重新索引,请查看此处:http://docs.marklogic.com/guide/admin/databases#id_28645

    【讨论】:

      【解决方案2】:

      禁用重新索引的方法:

      1. 使用管理界面,您可以disable reindexing

        • Databses -> select your content database
        • 在“配置”选项卡中,向下滚动到reindexer enable,然后选择false
        • 滚动到页面顶部或底部并点击ok按钮
      2. 以编程方式,使用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

      【讨论】:

        猜你喜欢
        • 2015-05-27
        • 2014-11-30
        • 1970-01-01
        • 2020-02-09
        • 1970-01-01
        • 2022-01-17
        • 2014-07-07
        • 2013-01-23
        • 1970-01-01
        相关资源
        最近更新 更多