From 6efcc94f35171c5b5159096f548b0b8b99daf4ca Mon Sep 17 00:00:00 2001 From: shubhisood Date: Tue, 18 Aug 2020 13:48:37 +0530 Subject: [PATCH] Reduced Bulk response size to improve performance --- reindexAuditLogs.js | 1 + reindexLogstashLogs.js | 1 + reindexRidesData.js | 1 + 3 files changed, 3 insertions(+) diff --git a/reindexAuditLogs.js b/reindexAuditLogs.js index 22b1abb..8ae3043 100644 --- a/reindexAuditLogs.js +++ b/reindexAuditLogs.js @@ -10,6 +10,7 @@ async function callBulkAPI(elindex) { const bulkResponse = await elasticClient.bulk({ body: elindex, timeout: '5m', + filterPath:'items.index._id,errors' }); if(bulkResponse.errors) { throw new Error(JSON.stringify(bulkResponse)); diff --git a/reindexLogstashLogs.js b/reindexLogstashLogs.js index acde1f2..694fa76 100644 --- a/reindexLogstashLogs.js +++ b/reindexLogstashLogs.js @@ -10,6 +10,7 @@ async function callBulkAPI(elindex) { const bulkResponse = await elasticClient.bulk({ body: elindex, timeout: '5m', + filterPath:'items.index._id,errors' }); if(bulkResponse.errors) { console.error('ERROR RESPONSE_____________________________'); diff --git a/reindexRidesData.js b/reindexRidesData.js index a96886e..0c4f63c 100644 --- a/reindexRidesData.js +++ b/reindexRidesData.js @@ -9,6 +9,7 @@ async function callBulkAPI(elindex) { const bulkResponse = await elasticClient.bulk({ body: elindex, timeout: '5m', + filterPath:'items.index._id,errors' }); if(bulkResponse.errors) { throw new Error(JSON.stringify(bulkResponse))