Rojan The range element indexes configuration XML you are getting from one database will act as the infut XML for the other. I guess following sample query will help you for loading the range indexes into other Marklogic DB.
import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy"; let $config := admin:get-configuration() let $indexes := admin:database-get-range-element-indexes( admin:get-configuration() , xdmp:database("old-db") ) let $retv := for $index in $indexes/element() let $rangespec := admin:database-range-element-index($index /scalar-type, $index/namespace-uri, $index/local-name, $index/collation, $index /range-value-position ) return xdmp:set($config, admin:database-add-range-element-index($ config, xdmp:database("new-db"), $rangespec) ) return admin:save-configuration($config) Abhishek Srivastav Tata Consultancy Services Cell:- +91-9883389968 Mailto: [email protected] Website: http://www.tcs.com ____________________________________________ Experience certainty. IT Services Business Solutions Outsourcing ____________________________________________ From: Rojan K K <[email protected]> To: [email protected] Date: 07/14/2011 11:50 AM Subject: [MarkLogic Dev General] creating indexes by getting it from from a remote db Sent by: [email protected] Hi , I would like to create all the indexes by getting it from a remote data base where its already available i am using admin:database-get-range-element-indexes($config, xdmp:database("myDatabase") ) to get all the indexes i have used in one data base. Please suggest me how can i load all these indexes to another data base in a different MarkLogic instance. regards, rojan_______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general =====-----=====-----===== Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you
_______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
