1
0
Fork 0

fix arangosearch explanation (#9365)

This commit is contained in:
Andrey Abramov 2019-06-28 19:51:34 +02:00 committed by Jan
parent 18042e16ec
commit cf7d5bfa95
1 changed files with 6 additions and 1 deletions

View File

@ -1104,7 +1104,12 @@ function processQuery(query, explain, planIndex) {
var sortCondition = '';
if (node.primarySort && Array.isArray(node.primarySort)) {
sortCondition = keyword(' SORT ') + node.primarySort.map(function (element) {
var primarySortBuckets = node.primarySort.length;
if (typeof node.primarySortBuckets === 'number') {
primarySortBuckets = Math.min(node.primarySortBuckets, primarySortBuckets);
}
sortCondition = keyword(' SORT ') + node.primarySort.slice(0, primarySortBuckets).map(function (element) {
return variableName(node.outVariable) + '.' + attribute(element.field) + ' ' + keyword(element.direction ? 'ASC' : 'DESC');
}).join(', ');
}