I need to run some integration tests on a service using Atlas Search in MongoDB Cloud. In order to do this, I want the test to create a fresh new database with a small collection and Atlas Search index each time it is ran.
I'm creating a collection and inserting a few documents in the MongoDB database in Mongo Atlas. Just a few milliseconds later, I'm creating an Atlas Search index by calling the Atlas API endpoint to Create One Atlas Search Index, from which I receive a response with a 200 status code and a payload with the status set to IN_PROGRESS (plus correct collectionName and database).
Then I start polling the endpoint to Return One Atlas Search Index, using the indexID I received in the creation response. This endpoint responds a few times as well with a 200 status code and a payload with the status set to IN_PROGRESS. After a few seconds, the endpoint responds with a 404 status code, with no details in the response about what happened to the index.
How can I find out why the index was not created? I don't see any endpoints that would allow this in the Atlas API.