@@ -1041,10 +1041,7 @@ function uploadFile(myfile, id, callback) {
10411041 query . device_id = params . qstring . device_id ;
10421042 }
10431043 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 } ;
10481045 }
10491046 if ( params . qstring . iSortCol_0 ) {
10501047 try {
@@ -1426,6 +1423,9 @@ function uploadFile(myfile, id, callback) {
14261423 common . db . collection ( 'feedback' + appId ) . ensureIndex ( {
14271424 "ts" : 1
14281425 } , function ( ) { } ) ;
1426+ common . db . collection ( 'feedback' + appId ) . ensureIndex ( {
1427+ comment : 'text' , email : 'text'
1428+ } , ( ) => { } ) ;
14291429 } ) ;
14301430 plugins . register ( "/i/apps/delete" , function ( ob ) {
14311431 var appId = ob . appId ;
@@ -1468,6 +1468,9 @@ function uploadFile(myfile, id, callback) {
14681468 common . db . collection ( 'feedback' + appId ) . ensureIndex ( {
14691469 "ts" : 1
14701470 } , function ( ) { } ) ;
1471+ common . db . collection ( 'feedback' + appId ) . ensureIndex ( {
1472+ comment : 'text' , email : 'text'
1473+ } , ( ) => { } ) ;
14711474 } ) ;
14721475 common . db . collection ( "events" + crypto . createHash ( 'sha1' ) . update ( "[CLY]_star_rating" + appId ) . digest ( 'hex' ) ) . drop ( function ( ) { } ) ;
14731476 if ( common . drillDb ) {
@@ -1487,6 +1490,9 @@ function uploadFile(myfile, id, callback) {
14871490 common . db . collection ( 'feedback' + appId ) . ensureIndex ( {
14881491 "ts" : 1
14891492 } , function ( ) { } ) ;
1493+ common . db . collection ( 'feedback' + appId ) . ensureIndex ( {
1494+ comment : 'text' , email : 'text'
1495+ } , ( ) => { } ) ;
14901496 } ) ;
14911497 common . db . collection ( "events" + crypto . createHash ( 'sha1' ) . update ( "[CLY]_star_rating" + appId ) . digest ( 'hex' ) ) . drop ( function ( ) { } ) ;
14921498 if ( common . drillDb ) {
0 commit comments