Dear All,

Is it possible to formulate a query which gives the distinct documents from a repository containing a specific word:

let $range := 1 to 640
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}'>{
 for $n score $s in $doc//*[text() contains text 'cezanne']
 return <hit score='{$s}'>{ $n }</hit>
}</document>

In this query I get the number of hits of all documents in the repository.

Thanks in advance!

Regards,

Wiard