Is it possible to force stop ongoing re-indexing in a MarkLogic database? If yes, how to do it?
2 Answers
You can disable reindexing, but it's worthwhile thinking about what problem you're trying to solve by doing that. Reindexing only happens if you change index settings, and presumably if you change index settings, you'll want the new settings to take effect. If you frequently change index settings and want to control how much resource goes into reindexing, you can also throttle.
To disable reindexing, look here: http://docs.marklogic.com/guide/admin/databases#id_28645
Means of disabling reindexing:
Using the Admin UI, you can disable reindexing:
Databses -> select your content database- in the Configure tab, scroll down to reindexer enable and select
false - Scroll to the top or bottom of the page and click the
okbutton
Programmatically, use the
admin:database-set-reindexer-enable()function: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 )
Rather than disabling reindexing, you can also adjust the throttle level through the Admin UI or by using admin:database-set-reindexer-throttle(), in order to minimize the performance impact.
https://developer.marklogic.com/blog/mitigating-the-impact-of-re-indexing