I am using MarkLogic to query over a relative large xml dataset. Now I am using two sets of query like these:
xdmp:estimate(cts:search(fn:doc(), cts:and-query(($query, $text-query, $sent-query))))
xdmp:estimate(cts:search(fn:doc(), cts:and-not-query(cts:and-query(($query, $text-query)), $sent-query)))
where, $text-query := cts:word-query("coke")
$sent-query := cts:and-query((cts:element-range-query(xs:QName("score_id"),">=",$lowValue), cts:element-range-query(xs:QName("score_id"),"<",$hiValue)))
$query := cts:word-query("diet coke")
$lowValue := 13264683002210000000;
$hiValue := 13264683002211000000;
For both the sets(query no. 1 and 2), I am getting some counts, but when I am removing the xdmp:estimate
part, the cts:search()
for query 1. is returning the xmls, where as for the query no. 2, I am getting an empty sequence.
My question is that, if cts:search
is not returning any xmls, then how can the xdmp:estimate
is counting the nodes for the query no. 2 ??
Is the cts:and-not-query
is not comfortable with the cts:element-range-query
, although ???
N.B. I am getting some counts with xdmp:estimate
with out any errors.
Range index is created over the field "score_id".