Loading TOC...
Matches for cat:function (cat:function (cat:function/javascript (cat:function/javascript (cat:function/javascript (cat:function ((cts:reference) AND cat:function)))))) have been highlighted. remove

MarkLogic Server 11.0 Product Documentation
cts.indexOrder

cts.indexOrder(
   index as cts.reference,
   [options as String[]]
) as cts.order

Summary

Creates a index-based ordering clause, for use as an option to cts.search.

Parameters
index A reference to a range index.
options Options. The default is ().

Options include:

"descending"
Results should be returned in descending order of index.
"ascending"
Results should be returned in ascending order of index.

Usage Notes

Only one of "ascending" or "descending" may be specified in the options parameter. If neither "ascending" nor "descending" is specified, then the default is "ascending".

Example

cts.indexOrder(cts.elementReference(xs.QName("TITLE")));

// returns the following:
// cts.indexOrder(cts.elementReference(fn.QName("","TITLE"),
//   ["type=string","collation=http://marklogic.com/collation/"]), "ascending")

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.