mirror of https://gitee.com/bigwinds/arangodb
changed behaviour of sorting documents - front-end
This commit is contained in:
parent
19062d9d57
commit
d17402f873
|
@ -94,8 +94,13 @@
|
||||||
query += this.setFiltersForQuery(bindVars);
|
query += this.setFiltersForQuery(bindVars);
|
||||||
// Sort result, only useful for a small number of docs
|
// Sort result, only useful for a small number of docs
|
||||||
if (this.getTotal() < 12000) {
|
if (this.getTotal() < 12000) {
|
||||||
query += " SORT TO_NUMBER(x." + this.getSort() + ") == 0 ? x."
|
if (this.getSort() === '_key') {
|
||||||
+ this.getSort() + " : TO_NUMBER(x." + this.getSort() + ")";
|
query += " SORT TO_NUMBER(x." + this.getSort() + ") == 0 ? x."
|
||||||
|
+ this.getSort() + " : TO_NUMBER(x." + this.getSort() + ")";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
query += " SORT x." + this.getSort();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bindVars.count !== 'all') {
|
if (bindVars.count !== 'all') {
|
||||||
|
|
Loading…
Reference in New Issue