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
<?xml version="1.0" encoding="UTF-8"?> | |
<collection xmlns="http://exist-db.org/collection-config/1.0"> | |
<index xmlns:xqi="http://xqueryinstitute.org/ns" xmlns:tei="http://www.tei-c.org/ns/1.0"> | |
<fulltext default="none" attributes="no"/> | |
<lucene> | |
<text qname="tei:title" boost="2.0"/> | |
<text qname="tei:stage"/> | |
<text qname="tei:sp"/> | |
<text qname="tei:body"/> | |
<text qname="tei:speaker"/> |
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
let $collection := 'PATH TO YOUR DATA' | |
for $play in collection($collection) | |
let $title := $play//tei:titleStmt/tei:title/text() | |
let $uri := base-uri($play) | |
return | |
<li> | |
<span class="title">{$title}.</span> | |
<span>{$uri}</span> | |
</li> |
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.0"; | |
declare namespace tei="http://www.tei-c.org/ns/1.0"; | |
declare namespace ft="http://exist-db.org/xquery/lucene"; | |
declare function local:search($terms as xs:string*) as node(){ | |
if(starts-with($terms,'"')) then | |
<query> | |
<phrase>{$terms}</phrase> | |
</query> |
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
let $collection := 'PATH TO YOUR DATA' | |
for $hits in collection($collection)//tei:sp[ft:query(.,'pox')] | |
return $hits |
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.0"; | |
module namespace search ="http://xqueryinstitute.org/search"; | |
declare namespace tei="http://www.tei-c.org/ns/1.0"; | |
declare function search:search($term as xs:string?) as element()* { | |
(for $hits in collection('/db/apps/xq-institute/data/plays')//tei:sp[ft:query(.,$term)] | |
return $hits)[position() = 1 to 10] | |
}; |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head></head> | |
<body> | |
Simple Search | |
<form action="search.xql" method="get"> | |
<input type="text" id="q" name="q"></input> | |
</form> | |
</body> | |
</html> |
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.0"; | |
import module namespace search = "http://xqueryinstitute.org/search" at "search.xqm"; | |
import module namespace render = "http://xqueryinstitute.org/render" at "render.xqm"; | |
declare variable $q {request:get-parameter('q','')}; | |
declare variable $rows {request:get-parameter('rows',5) cast as xs:integer}; | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head></head> |
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.0"; | |
module namespace search ="http://xqueryinstitute.org/search"; | |
declare namespace tei="http://www.tei-c.org/ns/1.0"; | |
(: | |
: Limit results/pagination | |
: Total hit count | |
: | |
: :) |
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.0"; | |
declare namespace tei="http://www.tei-c.org/ns/1.0"; | |
declare namespace xqi="http://xqueryinstitute.org/ns"; | |
(:~ | |
: Adds facets for speakers | |
: @param $hits passed from search function | |
: :) | |
declare function local:facet-speaker($hits as element()*) as element()*{ | |
for $speakers in $hits |
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.0"; | |
declare namespace tei="http://www.tei-c.org/ns/1.0"; | |
<div> | |
{ | |
for $person in collection("/db/apps/srophe/data/persons")//tei:persName[child::text()] | |
let $mistake := string-join($person/text(),' ') | |
let $uri := string($person/parent::tei:person/@xml:id) | |
let $source := $person/@source |
OlderNewer