We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
before
1 parent 0319c80 commit fe16d22Copy full SHA for fe16d22
x-pack/plugins/infra/server/lib/adapters/log_entries/kibana_log_entries_adapter.ts
@@ -113,13 +113,17 @@ export class InfraKibanaLogEntriesAdapter implements LogEntriesAdapter {
113
esQuery
114
);
115
116
- const hits = sortDirection === 'asc' ? esResult.hits.hits : esResult.hits.hits.reverse();
+ const hits = esResult.hits.hits;
117
const hasMore = hits.length > size;
118
119
if (hasMore) {
120
hits.pop();
121
}
122
123
+ if (sortDirection === 'desc') {
124
+ hits.reverse();
125
+ }
126
+
127
return {
128
documents: mapHitsToLogEntryDocuments(hits, fields),
129
hasMoreBefore: sortDirection === 'desc' ? hasMore : undefined,
0 commit comments