I would like to make a counter for the number of documents containing the terms from the query.
I made one in blue in the following query.
let $range := 1 to 800
for $doc in collection('brievenvangogh')
let $uri := base-uri($doc),
$num := substring($uri, string-length($uri) - 6, 3)
where $num castable as xs:integer
and xs:integer($num) = $range
return <document uri='{$uri}'>{
let $t := 0
for $n score $s in $doc//*[text() contains text {'gauguin','pissarro'}all ]
return $t:=+1;
return <hit score='{$s}'>{$n}{$t} }</hit>
}
</document>
Thank you in advance.