Skip to content

Instantly share code, notes, and snippets.

@AdamSteffanick
Forked from CliffordAnderson/01-contains.xqy
Created November 11, 2016 21:18
Show Gist options
  • Save AdamSteffanick/600cbc75bb0f8692133252f2f0ef0803 to your computer and use it in GitHub Desktop.
Save AdamSteffanick/600cbc75bb0f8692133252f2f0ef0803 to your computer and use it in GitHub Desktop.
XQuery Full Text
xquery version "3.1";
declare namespace tei = "http://www.tei-c.org/ns/1.0";
for $p in fn:collection("vwwp_tei")//tei:p
where fn:contains($p, "church")
return $p
xquery version "3.1";
declare namespace tei = "http://www.tei-c.org/ns/1.0";
for $p in fn:collection("vwwp_tei")//tei:p
where fn:matches($p, "church")
return $p
xquery version "3.1";
declare namespace tei = "http://www.tei-c.org/ns/1.0";
for $p in fn:collection("vwwp_tei")//tei:p
where $p contains text "church"
return $p
xquery version "3.1";
declare namespace tei = "http://www.tei-c.org/ns/1.0";
for $p in fn:collection("vwwp_tei")//tei:p
where $p contains text "church" using stemming
return $p
xquery version "3.1";
declare namespace tei = "http://www.tei-c.org/ns/1.0";
ft:mark(//tei:p[.//text() contains text "church"])
xquery version "3.1";
declare namespace tei = "http://www.tei-c.org/ns/1.0";
for $text score $score in (fn:collection("vwwp_tei")//tei:p)[. contains text "church"]
order by $score descending
return <hit score='{ format-number($score, "0.00") }'>{ $text }</hit>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment