Query question
Monday, 26 September 2011 · 1 message
WV
Wiard Vasen26 Sep 2011 09:55 #
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
Written for BaseX 6.7. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery