Browse Source

fix(log): replace brittle string extraction

pull/1220/head
Julian Simioni 6 years ago
parent
commit
c91fd58ec6
No known key found for this signature in database
GPG Key ID: B9EEB0C6EE0910A1
  1. 2
      controller/search.js
  2. 2
      controller/search_with_ids.js

2
controller/search.js

@ -116,7 +116,7 @@ function setup( apiConfig, esclient, query, should_execute ){
logger.info(messageParts.join(' ')); logger.info(messageParts.join(' '));
debugLog.push(req, {queryType: { debugLog.push(req, {queryType: {
[renderedQuery.type] : { [renderedQuery.type] : {
es_result_count: parseInt(messageParts[2].slice(17, -1)) es_result_count: _.get(res, 'data', []).length
} }
}}); }});
} }

2
controller/search_with_ids.js

@ -115,7 +115,7 @@ function setup( apiConfig, esclient, query, should_execute ){
logger.info(messageParts.join(' ')); logger.info(messageParts.join(' '));
debugLog.push(req, {queryType: { debugLog.push(req, {queryType: {
[renderedQuery.type] : { [renderedQuery.type] : {
es_result_count: parseInt(messageParts[2].slice(17, -1)) es_result_count: docs.length
} }
}}); }});

Loading…
Cancel
Save