Skip to content

Instantly share code, notes, and snippets.

@CliffordAnderson
Created November 11, 2016 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save CliffordAnderson/2aad2416c917181780930625d212707d to your computer and use it in GitHub Desktop.
Save CliffordAnderson/2aad2416c917181780930625d212707d 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