How to optimize search for database with 2M records

We tried using Strapi as a CRM. We have ~2 million contacts in our database. When we’d search for a contact it would take like 8 seconds for Strapi to display the result (which is too long to be workable for our users). Are there ways to optimize the search function?

I have stumbled upon Meilisearch as a search engine for Strapi.

There is a blogpost how to use this with Strapi.
How to Add Relevant Search to Your Strapi App Using MeiliSearch

There could be more search engines for Strapi.If you find more,please post them here.