> These examples work differently. So If I read this correctly, the number of results for 1. is still identical, right? However, in the second query in 2., no results are returned. You could report the query plan will give us some insight into what happens here.
> 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?