Cosmos’ emulated API is not the same product as MongoDB:
Text search (introduced in MongoDB 2.4, March 2013) is not currently supported by Cosmos’ emulated API and apparently is not on their roadmap per Add support for “Search text” ($text Operator).
If full MongoDB feature support is important to your use case, I would consider using MongoDB Atlas on Azure for a managed data service.