I think it's better to order by empty-sequence:

  for $x in cts:search(...)
  order by ()
  return $x

Using the profiler in cq, I can measure a small but consistent difference 
between this and 'order by cts:score($x)', with no change in ordering. If you 
do find you need cts:score, be sure to add 'descending'.

-- Mike

On 31 Aug 2011, at 15:00 , Mike Sokolov wrote:

> I have been assuming that this:
> 
> for $x in cts:search(...)
> return some-expression-involving($x)
> 
> is completely equivalent to this:
> 
> for $x in cts:search(...)
> order by cts:score() descending
> return some-expression-involving($x)
> 
> but is that true?
> 
> -- 
> Michael Sokolov
> Engineering Director
> www.ifactory.com
> 
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general
> 

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to