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

@@ -94,7 +94,9 @@ function RestQuery(config, auth, className, restWhere = {}, restOptions = {}, cl
var fields = restOptions.order.split(',');
this.findOptions.sort = fields.reduce((sortMap, field) => {
field = field.trim();
if (field[0] == '-') {
if (field === '$score') {
sortMap.score = {$meta: 'textScore'};
} else if (field[0] == '-') {
sortMap[field.slice(1)] = -1;
} else {
sortMap[field] = 1;