I have this query:

let $durations := cts:element-values(xs:QName("prof:overall-elapsed"), (), 
"descending",
                     cts:collection-query($collection))

And this query:

let $overall-elapsed := $profiles/prof:metadata/prof:overall-elapsed

Where there an element range index for prof:overall-elapsed.

Comparing the two results I get very different numbers when I expected them to 
be equal:

<count-overall-elapsed>47539</count-overall-elapsed>
<count-durations>21219</count-durations>

Doing this: 

count(distinct-values($overall-elapsed ! xs:dayTimeDuration(.))

Returns 21219, making it clear that the range index is returning distinct 
values, not all values. It makes sense in terms of how I would expect a range 
index to be structured (a one-to-many mapping for values to elements) but 
doesn’t make sense as the return for a function named “element-values” (and not 
element-distinct-values).

I didn’t see this behavior mentioned in the docs (although the introduction to 
the Lexicon reference section does describe lexicons as sets of unique values).

My requirement is to *quickly* get a list of the durations for all 
prof:expression elements (which I use for both counting and for bucketing, so I 
need all values, not just all distinct values).

Is there a way to do what I want using only indexes? 

Thanks,

E.
--
Eliot Kimber
http://contrext.com
 



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

Reply via email to