Search code examples
eve

Is it possible to do text search with EVE using the mongo text index?


Is it possible to use text search with EVE? It's implemented on mongo https://docs.mongodb.com/v3.2/text-search/ but I can't run it on EVE.

i.e.

find( { $text: { $search: "java \"coffee shop\"" } } )

Solution

  • Yes, The index must be created before

    For example (in the settings.py):

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

    and then

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