Thanks, it ran really fast ! On Thu, Jul 26, 2012 at 10:11 AM, Damon Feldman <damon.feld...@marklogic.com > wrote:
> 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:* general-boun...@developer.marklogic.com [mailto: > general-boun...@developer.marklogic.com] *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 > General@developer.marklogic.com > http://developer.marklogic.com/mailman/listinfo/general > >
_______________________________________________ General mailing list General@developer.marklogic.com http://developer.marklogic.com/mailman/listinfo/general