This can be done in the following two ways -
cts:search(
fn:collection("first-collection"),
cts:word-query("marklogic"))
In this, the scope is changed from all the documents to documents in collection "first-collection" only.
In the second approach, use ...