From 2cd845ab57a0e5929de22d91a2f14ee73385e09b Mon Sep 17 00:00:00 2001 From: anilb Date: Thu, 4 Jan 2024 22:27:59 +0100 Subject: [PATCH] prevent processing more than 1000 identities if member has it --- .../activities/member-merge-suggestions/getMergeSuggestions.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/apps/merge_suggestions_worker/src/activities/member-merge-suggestions/getMergeSuggestions.ts b/services/apps/merge_suggestions_worker/src/activities/member-merge-suggestions/getMergeSuggestions.ts index 5bd07d3b64..8b1fdacb81 100644 --- a/services/apps/merge_suggestions_worker/src/activities/member-merge-suggestions/getMergeSuggestions.ts +++ b/services/apps/merge_suggestions_worker/src/activities/member-merge-suggestions/getMergeSuggestions.ts @@ -86,7 +86,8 @@ export async function getMergeSuggestions( let hasFuzzySearch = false - for (const identity of member.nested_identities) { + // prevent processing more than 1000 identities because of opensearch limits + for (const identity of member.nested_identities.slice(0, 1000)) { if (identity.string_username.length > 0) { // weak identity search identitiesPartialQuery.should[1].nested.query.bool.should.push({