Hi Liam,
The following query gives me no results:
could you pass me on a document for testing? Your query seemed to do the right thing for the following document:
<dictionary><letter><entry><p>Paris</p></entry></letter></dictionary>
for $city as xs:string in ("Paris", "Cambridge", "London", "Oxford", ...) return ($city, fn:count(db:fulltext("with-sources", { $city })/ancestor::*:p/ancestor::*:entry), " ")
The optimized expression string does not always show the exact internal representation, so it may well be that something else happens when this query is evaluated. In the given case, there is no equivalent XQuery expression/function for the internal index rewriting, so the db:fulltext() function is shown instead.
Thanks, Christian