@@ -1041,10 +1041,7 @@ function uploadFile(myfile, id, callback) {
1041
1041
query . device_id = params . qstring . device_id ;
1042
1042
}
1043
1043
if ( params . qstring . sSearch && params . qstring . sSearch !== "" ) {
1044
- query . $or = [
1045
- { comment : { $regex : new RegExp ( `.*${ params . qstring . sSearch } .*` , 'i' ) } } ,
1046
- { email : { $regex : new RegExp ( `.*${ params . qstring . sSearch } .*` , 'i' ) } } ,
1047
- ] ;
1044
+ query . $text = { $search : params . qstring . sSearch } ;
1048
1045
}
1049
1046
if ( params . qstring . iSortCol_0 ) {
1050
1047
try {
@@ -1426,11 +1423,9 @@ function uploadFile(myfile, id, callback) {
1426
1423
common . db . collection ( 'feedback' + appId ) . ensureIndex ( {
1427
1424
"ts" : 1
1428
1425
} , function ( ) { } ) ;
1429
- common . db . collection ( 'feedback' + appId ) . ensureIndex (
1430
- { '$**' : 1 } ,
1431
- { wildcardProjection : { comment : 1 , email : 1 } , name : 'comment_*_email_*' } ,
1432
- ( ) => { } ,
1433
- ) ;
1426
+ common . db . collection ( 'feedback' + appId ) . ensureIndex ( {
1427
+ comment : 'text' , email : 'text'
1428
+ } , ( ) => { } ) ;
1434
1429
} ) ;
1435
1430
plugins . register ( "/i/apps/delete" , function ( ob ) {
1436
1431
var appId = ob . appId ;
@@ -1473,11 +1468,9 @@ function uploadFile(myfile, id, callback) {
1473
1468
common . db . collection ( 'feedback' + appId ) . ensureIndex ( {
1474
1469
"ts" : 1
1475
1470
} , function ( ) { } ) ;
1476
- common . db . collection ( 'feedback' + appId ) . ensureIndex (
1477
- { '$**' : 1 } ,
1478
- { wildcardProjection : { comment : 1 , email : 1 } , name : 'comment_*_email_*' } ,
1479
- ( ) => { } ,
1480
- ) ;
1471
+ common . db . collection ( 'feedback' + appId ) . ensureIndex ( {
1472
+ comment : 'text' , email : 'text'
1473
+ } , ( ) => { } ) ;
1481
1474
} ) ;
1482
1475
common . db . collection ( "events" + crypto . createHash ( 'sha1' ) . update ( "[CLY]_star_rating" + appId ) . digest ( 'hex' ) ) . drop ( function ( ) { } ) ;
1483
1476
if ( common . drillDb ) {
@@ -1497,11 +1490,9 @@ function uploadFile(myfile, id, callback) {
1497
1490
common . db . collection ( 'feedback' + appId ) . ensureIndex ( {
1498
1491
"ts" : 1
1499
1492
} , function ( ) { } ) ;
1500
- common . db . collection ( 'feedback' + appId ) . ensureIndex (
1501
- { '$**' : 1 } ,
1502
- { wildcardProjection : { comment : 1 , email : 1 } , name : 'comment_*_email_*' } ,
1503
- ( ) => { } ,
1504
- ) ;
1493
+ common . db . collection ( 'feedback' + appId ) . ensureIndex ( {
1494
+ comment : 'text' , email : 'text'
1495
+ } , ( ) => { } ) ;
1505
1496
} ) ;
1506
1497
common . db . collection ( "events" + crypto . createHash ( 'sha1' ) . update ( "[CLY]_star_rating" + appId ) . digest ( 'hex' ) ) . drop ( function ( ) { } ) ;
1507
1498
if ( common . drillDb ) {
0 commit comments