Danny,

A range index is exactly the right approach. You can access the values from 
that index using cts:element-values(xs:QName("assetType")).

Yours,
Damon

From: [email protected] 
[mailto:[email protected]] On Behalf Of Danny Sinang
Sent: Thursday, July 26, 2012 9:39 AM
To: general
Subject: [MarkLogic Dev General] Fast way to get distinct values of a child 
element

What's a fast way to get distinct values of a child element ?

Right now, doing this :

let $types := fn:distinct-values(/asset/assetMeta/assetType)

takes forever because there are 4 million+ asset docs existing.

There is a range element index for assetType though.

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

Reply via email to