How to preserve relevance order of cts:search results

Viewed 55

I have the following codes:

1)

for $song in cts:search(fn:doc(), "night")
return $song/ts:top-song/ts:title/text() 

2)

cts:search(fn:doc(), "night")/ts:top-song/ts:title/text()

cts:search returns documents as per the relevance. Both the codes, return results in a different order. Which would return the result with the correct relevance and why ?

1 Answers
Related