Thanks Brad. This works for me

From: [email protected] 
[mailto:[email protected]] On Behalf Of Rix, Brad
Sent: Tuesday, August 27, 2013 3:51 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] clear indexes programmatically

One way would be to go through each of your index types and delete each type.

For example, the following will delete element range indexes and attribute 
range indexes.  You can add more to delete the other index types:

    let $cluster-config := admin:get-configuration()
    let $dbid := xdmp:database("YOUR_DATABASE_NAME")

    (: Remove the old Element Range Indexes :)
    let $cluster-config :=
        admin:database-delete-range-element-index
        (
            $cluster-config,
            $dbid,
            admin:database-get-range-element-indexes($cluster-config, $dbid)
        )

    (: Remove the old Attribute Range Indexes :)
    let $cluster-config :=
        admin:database-delete-range-element-attribute-index
        (
            $cluster-config,
            $dbid,
            admin:database-get-range-element-attribute-indexes($cluster-config, 
$dbid)
        )

    (: Repeat with all of the index types that have in your database :)

    return
        admin:save-configuration($cluster-config)

Brad Rix
Technical Lead





Office:

+1.303.542.2172

Mobile:

+1.303.915.2771

Fax:

+1.303.544.0522

IM/Gmail Name:

bradford.rix









[cid:[email protected]]<http://www.flatironssolutions.com/>

www.FlatironsSolutions.com<http://www.FlatironsSolutions.com>

[email protected]<mailto:[email protected]>





From: 
[email protected]<mailto:[email protected]>
 [mailto:[email protected]] On Behalf Of 
[email protected]<mailto:[email protected]>
Sent: Tuesday, August 27, 2013 2:20 PM
To: [email protected]<mailto:[email protected]>
Subject: [MarkLogic Dev General] clear indexes programmatically

Hi All,

Is there any api method to delete/clear all the indexes programmatically ? what 
is the best way of deleting all the indexes at one go

Praveen

<<inline: image001.png>>

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to