Simple expressions using the full-text index
Find out where Juliet talks about love
In the following, Jon Bosak's edition of the Shakespeare's Hamlet, Macbeth, and Romeo and Juilet are queried..
//SPEECH[ft:query(., 'love')][SPEAKER = "JULIET"]
Search for a phrase
//SPEECH[ft:query(., '"fenny snake"')]
Find speeches in which "love" and "father" occur closely together, using XML query syntax:
let $query :=
<query>
<near slop="20"><term>love</term><near>father</near></near>
</query>
return //SPEECH[ft:query(., $query)]
Find speeches in which "boil" and "bubble" occur, ordering them by full-text match score
for $m in //SPEECH[ft:query(., "boil bubble")]
let $score := ft:score($m)
order by $score descending
return <m score="{$score}">{$m}</m>