I'm finding a related element through it's id, stored in a reference element's href, like so:
let $item := ($doc//(map|question|theory|reading|glossgroup))[@id = $ref/@href]
Reading ExistDB's documentation, I'm pretty sure a simple <create qname="@ID" type="xs:string" />
index should've been enough, and should perhaps even be autogenerated.. but looking at the profiler, my query is not using any indexes.
I've even tried
let $item := $doc//map[@id = $ref/@href]
And created an index with the id field like so
<index>
<range>
<create qname="map" type="xs:string">
<field name="map-id" match="@id" type="xs:string" />
</create>
</range>
</index>
But nothing seems to be working.
I'm pretty new to ExistDB.. probably doing something obvious wrong, so if anybody can point me in the right direction :)?
Example XML:
<root>
<map id="ide931fee3-6a45-4435-a8d2-f018ae2ca2ea">
<mapref href="f80cc8c8-6b6d-4005-b2e9-85eac2ee2fbf.1.36" />
</map>
<map id="f80cc8c8-6b6d-4005-b2e9-85eac2ee2fbf.1.36">
<topicref href="47aed1dd-62f7-4fb6-ae76-dbfcde0a4bab.1.9" />
</map>
<question id="47aed1dd-62f7-4fb6-ae76-dbfcde0a4bab.1.9">
...
</question>
</root>