Hi there,

Can anybody tell me whether this is a bug or a feature?

Thanks,
Andreas

2015-05-13 17:08 GMT+02:00 Andreas Hubmer <andreas.hub...@ebcont.com>:

> Hi,
>
> cts:frequency returns unexpected values when called on an item retrieved
> with cts:element-values on multiple elements and the option
> "fragment-frequency".
>
> Let me give an example:
> xquery version "1.0-ml";
> (: an element range index is needed for both elements "a" and "b" :)
> xdmp:document-insert("/test.xml",
>   <root>
>     <a>A</a>
>     <a>A</a>
>     <b>A</b>
>   </root>)
> ;
> for $val in cts:element-values((xs:QName("a"), xs:QName("b")), (),
> "fragment-frequency")
>   return $val || ": " || cts:frequency($val)
>
> I would expect that the fragment frequency of the value "A" is 1. But the
> result is 2 because MarkLogic seems to count the frequencies of the two
> elements a and b separately and return the sum.
> When using item frequency the result is 3, as expected.
>
> Is this a bug or a feature? In case of the latter it would be nice to
> document this behavior.
>
> As a workaround, to get the "real" fragment frequency I will use a field
> range index and cts:field-values
>
> Regards,
> Andreas
>
> --
> Andreas Hubmer
> IT Consultant
>
> Email: andreas.hub...@ebcont.com
> Web: http://www.ebcont.com
>
> OUR TEAM IS YOUR SUCCESS
>
> UID-Nr. ATU68135644
> HG St.Pölten - FN 399978 d
>
_______________________________________________
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to