Hi Huib,
> However, using 8.2 I managed to load the entire Dutch legislation documents
> into 5 separate databases. Yay!
Good to hear!
> Anyway, and I must confess I am a bit lazy here, how do I run a query over
> multiple databases/collections in BaseX? Of course I would like to run the
> same dumb count query in BaseX too, over these 5 databases containing all my
> data, see if it works...
This could be a solution:
count(
for $name in ('laws1', 'laws2')
return db:open($name)//law
)
This could be another:
count(
for $i in 1 to 5
let $name := 'laws' || $i
return db:open($name)//law
)
This is a third (it may be the fastest one, because the dynamic
binding of database names in the first 2 queries prevents some
optimizations to be triggered):
sum(
for $i in 1 to 5
let $query := 'count(db:open("db' || $i || '")//law)'
return xquery:eval($query)
)
Hope this helps,
Christian