-
-
Save joewiz/a652fe44045d2808d2ef26c1528b4079 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "3.1"; | |
declare namespace tei = "http://www.tei-c.org/ns/1.0"; | |
let $set-up-collections := | |
( | |
xmldb:create-collection('/db', 'test'), | |
xmldb:create-collection('/db/system/config/db', 'test') | |
) | |
let $in-memory-node := | |
<listPerson xmlns="http://www.tei-c.org/ns/1.0"> | |
<person> | |
<persName xml:id="person"> | |
<forename/> | |
<surname/> | |
</persName> | |
</person> | |
</listPerson> | |
let $store-unindexed-doc := xmldb:store('/db', 'test.xml', $in-memory-node) | |
let $store-indexed-doc := xmldb:store('/db/test', 'test.xml', $in-memory-node) | |
let $config := | |
<collection xmlns="http://exist-db.org/collection-config/1.0"> | |
<index xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tei="http://www.tei-c.org/ns/1.0"> | |
<!--<fulltext default="none" attributes="false"/>--> | |
<lucene> | |
<analyzer class="org.apache.lucene.analysis.standard.StandardAnalyzer"/> | |
<text qname="tei:div"/> | |
</lucene> | |
</index> | |
</collection> | |
let $store-config := xmldb:store('/db/system/config/db/test', 'collection.xconf', $config) | |
let $reindex := xmldb:reindex('/db/test') | |
let $on-disk-unindexed-node := doc('/db/test.xml')/tei:listPerson/tei:person/tei:persName | |
let $on-disk-indexed-node := doc('/db/test/test.xml')/tei:listPerson/tei:person/tei:persName | |
for $node in ($in-memory-node/tei:person/tei:persName, $on-disk-unindexed-node, $on-disk-indexed-node) | |
return | |
($node/tei:forename and $node/tei:surname) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment