I am trying to find use the cts:value-co-occurrences
of a give document property for a given search string,, When I do the regular search I get 546 results back but when I do with cts:value-co-occurrence, I get only 3 documents.. Following is my code
xquery version "1.0-ml";
declare namespace html = "http://www.w3.org/1999/xhtml";
declare namespace prop = "http://marklogic.com/xdmp/property";
declare namespace meta = "http://ir.abbivenet.com/content-repo/metadata";
import module namespace search = "http://marklogic.com/appservices/search" at "/MarkLogic/appservices/search/search.xqy";
import module namespace functx = "http://www.functx.com" at "/MarkLogic/functx/functx-1.0-doc-2007-01.xqy";
let $q := "(TNF)"
let $options :=
<options xmlns="http://marklogic.com/appservices/search">
<constraint name="collection">
<collection prefix=""/>
</constraint>
<constraint name="properties">
<properties />
</constraint>
<term>
<term-option>case-insensitive</term-option>
<term-option>punctuation-insensitive</term-option>
<term-option>whitespace-insensitive</term-option>
<term-option>wildcarded</term-option>
</term>
<return-facets>false</return-facets>
<return-values>false</return-values>
<return-constraints>false</return-constraints>
<return-frequencies>false</return-frequencies>
<return-qtext>false</return-qtext>
<search-option>unfaceted</search-option>
<search-option>score-simple</search-option>
</options>
let $start := 1
let $page-length :=1000000
let $query-original := cts:query(search:parse($q, $options))
let $m := cts:value-co-occurrences(
cts:element-reference(xs:QName('meta:id')),
cts:uri-reference(),
('map','properties'), $query-original)
return $m
This returns only 3 results.. but if I do the following I get 546 results
let $result := search:search($q, $options, $start, $page-length)
return $result
All the documents have the property <id>
, so I do not understand why the difference.. I understand I am using map
, so will return or should return unique <id>
keys.. if that is the case I should get 241 results not 3.