@@ -301,10 +301,10 @@ RemoteStorage.prototype.createNewIndex = function (indexName, callback) {
301301
302302 let envelopeMapping = {
303303 properties : {
304- title : { type : 'string ' , index : 'analyzed ' } ,
305- body : { type : 'string ' , index : 'analyzed ' } ,
306- keywords : { type : 'string ' , index : 'analyzed ' } ,
307- categories : { type : 'string ' , index : 'not_analyzed ' }
304+ title : { type : 'text ' , index : true , copy_to : 'all ' } ,
305+ body : { type : 'text ' , index : true , copy_to : 'all ' } ,
306+ keywords : { type : 'text ' , index : true , copy_to : 'all ' } ,
307+ categories : { type : 'text ' , index : false , copy_to : 'all ' }
308308 }
309309 } ;
310310
@@ -347,8 +347,7 @@ RemoteStorage.prototype.makeIndexActive = function (indexName, callback) {
347347
348348 connection . elastic . indices . get ( {
349349 index : 'envelopes*' ,
350- ignoreUnavailable : true ,
351- feature : '_settings'
350+ ignoreUnavailable : true
352351 } , ( err , response , status ) => {
353352 if ( err ) return callback ( err ) ;
354353
@@ -374,11 +373,13 @@ RemoteStorage.prototype.queryEnvelopes = function (query, categories, pageNumber
374373 const q = { } ;
375374
376375 if ( ! categories ) {
377- q . match = { _all : query } ;
376+ q . match = { all : query } ;
378377 } else {
379- q . filtered = {
380- query : { match : { _all : query } } ,
381- filter : { terms : { categories : categories } }
378+ q . bool = {
379+ must : {
380+ match : { all : query } ,
381+ filter : { terms : { categories : categories } }
382+ }
382383 } ;
383384 }
384385
0 commit comments