2016-11-15 66 views

回答

2

是,該指數必須創建

例如(在settings.py)之前:

'mongo_indexes' : {'text': ([('names.keyword', "text")])} 

然後

localhost:5000/api/images?where={"$text": {"$search": "food dog"}} 
+1

中當然你也可以從mongo shell建立索引。然而,對於'mongo_indexes',Eve會在啓動時創建索引(如果缺失),這很方便,並確保您始終在正確索引的數據庫上運行。 –