Skip to content

Instantly share code, notes, and snippets.

@ryanjdew
Created June 8, 2012 13:12
Show Gist options
  • Select an option

  • Save ryanjdew/2895537 to your computer and use it in GitHub Desktop.

Select an option

Save ryanjdew/2895537 to your computer and use it in GitHub Desktop.
Example cts:word-query without synonym option
element results {
for $i in cts:search(/content,
cts:word-query(('Jesus Christ','Christ','Messiah','Savior','Redeemer','Lord'),('case-sensitive'))
)
[1 to 10]/(element title { attribute score {cts:score(.)}, string(title)})
order by $i/@score descending, $i ascending
return $i
}
(: =>
<results>
<title score="58453">The Messianic Expectation</title>
<title score="58197">The Book of Mormon on Christ’s Role as Redeemer</title>
<title score="58069">“We Prophesy of Christ”: The Law of Witnesses in 2 Nephi</title>
<title score="57557">“The Light and Life of the World”</title>
<title score="56576">Jesus the Christ: Our Master and More</title>
<title score="56235">He Lives! The Witness of Latter-day Prophets</title>
<title score="56149">“Another Testament of Jesus Christ”</title>
<title score="55509">Special Witnesses of Christ</title>
<title score="55339">One Family’s Testimony of Christ</title>
<title score="54997">The Establishment of Zion (Isaiah 1–12)</title>
</results>
:)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment