Description
TL;DR
Admin endpoint POST /v4/projects/admin/es/project/index
for indexing project from DB to ES sends multiple requests to Member Service to populate user details but we never use this data.
Details
When index projects using admin endpoint it retrieves data from the Member Service for each project member and additionally populates 'handle', 'firstName', 'lastName', 'email' for each them: https://github.com/topcoder-platform/tc-project-service/blob/dev/src/routes/admin/project-index-create.js#L74-L88
This was implemented this way because we do the same when we index members in ES during adding them: https://github.com/topcoder-platform/tc-project-service/blob/dev/src/events/projectMembers/index.js#L90-L91
Even though we add these additional details to the ES index, we actually never use them in Connect App V4. As by default, these fields are not returned by project listing endpoint, and we don't request them: https://api.topcoder-dev.com/v4/projects/?limit=20&offset=0&fields=id,name,description,members,status,type,actualPrice,estimatedPrice,createdAt,updatedAt,createdBy,updatedBy,details,lastActivityAt,lastActivityUserId,version,templateId&sort=updatedAt+desc
, see a screenshot of returned data:
In Project Service V5 we even don't populate user details to the project member records anymore https://github.com/topcoder-platform/project-processor-es/blob/develop/src/services/ProcessorServiceProjectMember.js#L53-L64 and Connect App still works well without such data added to ES.
Summary
So I propose to remove this logic from this admin endpoint and don't request user details for members, this should dramatically speed up indexing via this endpoint.
FYI @vikasrohit