feat: Full Text Search Support (#3904)

* Full Text Support

* invalid input test

* Support for sort

* index exist test

* clean up

* better error messaging

* postgres support

* error instructions for $diacritic and $case sensitivity

* nit

* nit

* nit

* separate test for full text
This commit is contained in:
Diamond Lewis
2017-06-13 20:42:59 -05:00
committed by Florent Vilmart
parent 5f991e90fb
commit 8b21d5ab80
7 changed files with 575 additions and 2 deletions

View File

@@ -14,6 +14,11 @@ export default class MongoCollection {
// This could be improved a lot but it's not clear if that's a good
// idea. Or even if this behavior is a good idea.
find(query, { skip, limit, sort, keys, maxTimeMS } = {}) {
// Support for Full Text Search - $text
if(keys && keys.$score) {
delete keys.$score;
keys.score = {$meta: 'textScore'};
}
return this._rawFind(query, { skip, limit, sort, keys, maxTimeMS })
.catch(error => {
// Check for "no geoindex" error