How can I create an index with pymongo [duplicate]
Use the create_index method where you pass in the keys as an array and TEXT as the index direction : collection.create_index([(‘field_i_want_to_index’, pymongo.TEXT)], name=”search_index”, default_language=”english”)