I've been struggling to figure out how to do this for the past two hours. But I can't seem to get the Promise to wait for my searchFacesFunc to complete before it solves. What is the correct way to do so?
async function searchFacesFunc(faceId){
     var searchFacesParams = {
      CollectionId: "my-collection", 
      FaceId: faceId,
      FaceMatchThreshold: 80, 
      MaxFaces: 10
     };
     await rekognition.searchFaces(searchFacesParams, function(err, data) {
     if(err){
        throw err;
     }else{
        var matching_percent = data.FaceMatches[0].Similarity;   
        console.log('Matching Percent: ' + matching_percent);
     }
   });
 }
 return new Promise((resolve, reject) => {
     rekognition.indexFaces(indexParams, function(err, data) {
             if(err){
                 throw err;
             }else{
                 const faceRecords = data.FaceRecords;
                 for(let i = 0; i < faceRecords.length; i++){
                     var faceId = faceRecords[i].Face.FaceId;
                     console.log('FaceId: ' + faceId);
                     searchFacesFunc(faceId); //The promise is finished before these multiple functions finish
                 }
                resolve(null, 'success');
             }
     });
 });
 
    