commit
a96e14b62f
|
@ -324,6 +324,7 @@ define(function (require) {
|
|||
*/
|
||||
var sortBy = (function () {
|
||||
if (!_.isArray(sort)) return 'implicit';
|
||||
else if (sort[0] === '_score') return 'implicit';
|
||||
else if (sort[0] === timeField) return 'time';
|
||||
else return 'non-time';
|
||||
}());
|
||||
|
@ -334,6 +335,7 @@ define(function (require) {
|
|||
}
|
||||
|
||||
$scope.updateTime();
|
||||
if (sort[0] === '_score') segmented.setMaxSegments(1);
|
||||
segmented.setDirection(sortBy === 'time' ? (sort[1] || 'desc') : 'desc');
|
||||
segmented.setSize(sortBy === 'time' ? $scope.opts.sampleSize : false);
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ define(function (require) {
|
|||
// export a couple methods from the request
|
||||
this.setDirection = _.bindKey(req, 'setDirection');
|
||||
this.setSize = _.bindKey(req, 'setSize');
|
||||
this.setMaxSegments = _.bindKey(req, 'setMaxSegments');
|
||||
}
|
||||
|
||||
return SegmentedHandle;
|
||||
|
|
|
@ -118,6 +118,15 @@ define(function (require) {
|
|||
** SegmentedReq specific methods
|
||||
*********/
|
||||
|
||||
/**
|
||||
* Set the sort total number of segments to emit
|
||||
*
|
||||
* @param {number}
|
||||
*/
|
||||
SegmentedReq.prototype.setMaxSegments = function (maxSegments) {
|
||||
this._maxSegments = Math.max(_.parseInt(maxSegments), 1);
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the sort direction for the request.
|
||||
*
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
sorting="sorting">
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="row in page|limitTo:limit track by row._index+row._type+row._id"
|
||||
<tr ng-repeat="row in page|limitTo:limit track by row._index+row._type+row._id+row._score"
|
||||
kbn-table-row="row"
|
||||
columns="columns"
|
||||
sorting="sorting"
|
||||
|
@ -30,7 +30,7 @@
|
|||
sorting="sorting">
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="row in hits|limitTo:limit track by row._index+row._type+row._id"
|
||||
<tr ng-repeat="row in hits|limitTo:limit track by row._index+row._type+row._id+row._score"
|
||||
kbn-table-row="row"
|
||||
columns="columns"
|
||||
sorting="sorting"
|
||||
|
|
Loading…
Reference in a new issue