Hi,
I am looking into using Loopback as a new backend for out AngularJS application and was looking into full text search, we are looking to migrate to a MongoDB and I noticed that you can create text indexes, but I cannot seem to create them in the model.json in loopback. Do I need to create the index in a bootscript, if so how can I access the raw mongo connector to modify run the Model.createIndex() function?
I tried adding this to the models property
"index": true
But I am still getting this when running filer[where][$text][search] = 'time'
{
"error": {
"name": "MongoError",
"status": 500,
"message": "Unable to execute query: error processing query: ns=db.model limit=1000 skip=0\nTree: TEXT : query=space, language=, tag=NULL\nSort: { _id: 1 }\nProj: {}\n planner returned error: need exactly one text index for $text query",
"$err": "Unable to execute query: error processing query: ns=db.model limit=1000 skip=0\nTree: TEXT : query=space, language=, tag=NULL\nSort: { _id: 1 }\nProj: {}\n planner returned error: need exactly one text index for $text query",
"code": 17007
}
}
Many thanks in advance