Lines 326-333
Link Here
|
326 |
let subquery_and = []; |
326 |
let subquery_and = []; |
327 |
patterns.forEach(function(pattern,i){ |
327 |
patterns.forEach(function(pattern,i){ |
328 |
let sub_or = []; |
328 |
let sub_or = []; |
|
|
329 |
let cur_search_type = search_type; |
330 |
if( pattern.slice(0,1) == '^' ){ |
331 |
cur_search_type = "starts_with"; |
332 |
pattern = pattern.substr(1); |
333 |
} |
329 |
search_fields.split(',').forEach(function(attr,ii){ |
334 |
search_fields.split(',').forEach(function(attr,ii){ |
330 |
sub_or.push({["me."+attr]:{"like":(search_type == "contain" ? "%" : "" ) + pattern + "%"}}); |
335 |
sub_or.push({["me."+attr]:{"like":(cur_search_type == "contain" ? "%" : "" ) + pattern + "%"}}); |
331 |
if ( attr == 'dateofbirth' ) { |
336 |
if ( attr == 'dateofbirth' ) { |
332 |
try { |
337 |
try { |
333 |
let d = $date_to_rfc3339(pattern); |
338 |
let d = $date_to_rfc3339(pattern); |