| ... | ... | @@ -206,9 +206,23 @@ Returns one row: |
|
|
|
|
|
|
|
# Ordering
|
|
|
|
|
|
|
|
Ordering can be defined by the "order_by" attribute:
|
|
|
|
|
|
|
|
|
|
|
|
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 ? */
|
|
|
|
] |
|
|
|
|
|
|
|
|
The API also supports [similarity](/API/Queries/Query-Search-Options#similarity) for sorting.
|
|
|
|
|
| ... | ... | |