Hmm..
These examples work differently.
1.
(# db:enforceindex #) {
for $db in db:list()[starts-with(.,'000999~')]
return db:open($db)//*[text() contains text { 'болт' } any]
}
378 rows
let $dbs := for $i in db:list()[starts-with(.,'000999~')] return $i
for $db in $dbs
let $ft := ft:search($db, "болт")/parent::*
for $node in $ft
return $node
378 rows
2.
(# db:enforceindex #) {
for $db in db:list()[starts-with(.,'000999~')]
return db:open($db)//*[text() contains text { 'автомобиль' } any]
}
0 rows
let $dbs := for $i in db:list()[starts-with(.,'000999~')] return $i
for $db in $dbs
let $ft := ft:search($db, "автомобиль")/parent::*
for $node in $ft
return $node
2138 rows
Why do they work differently?
let $dbs := for $i in db:list()[starts-with(.,'000999~')] return $i
for $db in $dbs
for $doc in db:open($db)/.//*[(# db:enforceindex #) { text() contains text { 'TEN-9258' } any }]
return $doc
Maybe you’ll have to use the pragma on top of your expression:
(# db:enforceindex #) {
for $db in db:list()[starts-with(.,'000999~')]
return db:open($db)//*[text() contains text 'TEN-9258']
}
As you may have seen, I have simplified `/.//*` to `//*` (but maybe it
was optimized to this representation anyway).
Cheers,
Christian