[MarkLogic Dev General] Frequency and Search Results in 3.2

Bilal Khalid bilal at scholarsportal.info
Wed May 23 14:40:15 PDT 2007


Hello All,

I've been trying to resolve the frequency count (retrieved through a
function like cts:element-values) into actual search results in 3.2, but the
number of results does not match the frequency count. The example below
shows the query I've been trying out in CQ.

let $elem := cts:element-values(xs:QName("kwd"), "",
("frequency-order","fragment-frequency"), cts:element-query(xs:QName("kwd"),
"water"))[1]
let $freq := cts:frequency($elem)
let $cnt := xdmp:estimate(cts:search(doc(),
cts:element-query(xs:QName("kwd"), $elem)))
return concat ($elem, " (freq: ", $freq, ") (search: ", $cnt, ")")

Please note that I use cts:element-query in both lexicon and search queries.
The only difference is that the search parameter in the second query is
changed to the first item of the results from the lexicon.

-Bilal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://xqzone.marklogic.com/pipermail/general/attachments/20070523/b61821c1/attachment.html


More information about the General mailing list