Skip to content

Commit

Permalink
display hits and total hits for courier inspector requests (#23434)
Browse files Browse the repository at this point in the history
* display hits and total hits for courier inspector requests

* update Hits help text to explain difference between total hits

* fix functional test
  • Loading branch information
nreese authored Sep 24, 2018
1 parent 5d9d724 commit 1b763d8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/ui/public/courier/utils/courier_inspector_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,15 @@ function getResponseInspectorStats(searchSource, resp) {
}

if (resp && resp.hits) {
stats.Hits = {
stats['Hits (total)'] = {
value: `${resp.hits.total}`,
description: 'The number of documents that match the query.',
};

stats.Hits = {
value: `${resp.hits.hits.length}`,
description: 'The number of documents returned by the query.',
};
}

if (lastRequest && (lastRequest.ms === 0 || lastRequest.ms)) {
Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/discover/_inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function ({ getService, getPageObjects }) {
const STATS_ROW_VALUE_INDEX = 1;
function getHitCount(requestStats) {
const hitsCountStatsRow = requestStats.find((statsRow) => {
return statsRow[STATS_ROW_NAME_INDEX] === 'Hits';
return statsRow[STATS_ROW_NAME_INDEX] === 'Hits (total)';
});
return hitsCountStatsRow[STATS_ROW_VALUE_INDEX];
}
Expand Down

0 comments on commit 1b763d8

Please sign in to comment.