Slow response when combine MongoDB Search Index and AWS Lembda

I wanted to create a serverless application on AWS so I have created a search index on MongoDB Atlas and Lambda Function on AWS. I don’t why response time is very slow. It is tacking 4 sec. So for the testing purpose, I have created Realm Function and it is tacking 238 ms. Can you please give any solution on how can I use the Lambda function with this response time.