How to create search indexes in atlas using Pymongo

I’m trying to create a Full text search functionality using Flask and Pymongo with hosted atlas.
We have a very specific use case where we need to create a new collection using the id of a customer in the customer db.
We want to add search indexes to our collections every time a new one is created. Couldn’t find a dedicated documentation how to achieve that using the Pymongo. package.

Some help would be highly appreciated