| ... | ... | @@ -208,22 +208,28 @@ Returns one row: |
|
|
|
|
|
|
|
Ordering can be defined by the "order_by" attribute.
|
|
|
|
|
|
|
|
Given | Will Generate
|
|
|
|
---------------------------------------------------------------
|
|
|
|
"colA" | ORDER BY colA
|
|
|
|
["colA", "colB"] | ORDER BY colA, colB
|
|
|
|
{"-asc" : "colA"} | ORDER BY colA ASC
|
|
|
|
{"-desc" => "colB"} | ORDER BY colB DESC
|
|
|
|
["colA", {-asc => "colB"}] | ORDER BY colA, colB ASC
|
|
|
|
{ "-asc" => ["colA","colB"] } | ORDER BY colA ASC, colB ASC
|
|
|
|
[ "FUNC(colA,?)", "bla" ] | ORDER BY FUNC(colA, ?) /* with "bla bound to ? */
|
|
|
|
[ | ORDER BY
|
|
|
|
{ "-asc" => "colA" }, | colA ASC,
|
|
|
|
{ "-desc" => ["colB"] }, | colB DESC,
|
|
|
|
{ "-asc" => ["colC","colD"] },| colC ASC, colD ASC,
|
|
|
|
[ "FUNC(colF, ?)", "bla" ], | FUNC(colF, ?) /* with "bla bound to ? */
|
|
|
|
| Given | Will Generate|
|
|
|
|
|----|-----------|
|
|
|
|
|"colA" | ORDER BY colA|
|
|
|
|
|["colA", "colB"] | ORDER BY colA, colB|
|
|
|
|
|{"-asc" : "colA"} | ORDER BY colA ASC|
|
|
|
|
|{"-desc" => "colB"} | ORDER BY colB DESC|
|
|
|
|
|["colA", {-asc => "colB"}] | ORDER BY colA, colB ASC|
|
|
|
|
|{ "-asc" => ["colA","colB"] } | ORDER BY colA ASC, colB ASC|
|
|
|
|
|[ "FUNC(colA,?)", "bla" ] | ORDER BY FUNC(colA, ?) /* with "bla bound to ? */|
|
|
|
|
|[ | ORDER BY
|
|
|
|
{ "-asc" => "colA" },
|
|
|
|
{ "-desc" => ["colB"] },
|
|
|
|
{ "-asc" => ["colC","colD"] },
|
|
|
|
[ "FUNC(colF, ?)", "bla" ],
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
|
```colA ASC,
|
|
|
|
colB DESC,
|
|
|
|
colC ASC, colD ASC,
|
|
|
|
FUNC(colF, ?) /* with "bla bound to ? */```
|
|
|
|
|
|
|
|
The API also supports [similarity](/API/Queries/Query-Search-Options#similarity) for sorting.
|
|
|
|
|
|
|
|
Any column from a joined/prefetched table or a column selected with ["select"](#select-as) can be used.
|
| ... | ... | |