The AND LIKE query is now working!
This commit is contained in:
@@ -140,10 +140,25 @@ $: if ($events_trigger == 'load__event_badge_obj_li' && $events_slct.event_id) {
|
||||
}
|
||||
|
||||
let type_code = $events_sess.badges.search_badge_type_code;
|
||||
|
||||
let search_str = $events_sess.badges.fulltext_search_qry_str.trim();
|
||||
// Add quotes around the search string to make it an exact match.
|
||||
search_str = `"${search_str}"`;
|
||||
console.log(search_str);
|
||||
let search_method = 'lk'; // 'ft', 'lk', 'eq'
|
||||
let ft_search_str_new = '';
|
||||
let lk_search_str_new = '';
|
||||
|
||||
if (search_method == 'ft') {
|
||||
// Add quotes around the search string to make it an exact match.
|
||||
ft_search_str_new = `"${search_str}"`;
|
||||
} else if (search_method == 'lk') {
|
||||
// Add a wildcard to the search string to make it a like match.
|
||||
lk_search_str_new = search_str.trim().replace(',', ' ').replace(';', ' ').replace(' ', '%').replace(' ', '%');
|
||||
lk_search_str_new = `%${lk_search_str_new}%`;
|
||||
}
|
||||
console.log(`"${search_str}"`);
|
||||
|
||||
let params = {
|
||||
'qry__limit': 35,
|
||||
}
|
||||
|
||||
if ($events_sess.status_qry__search == 'loading') {
|
||||
console.log('*** $events_sess.status_qry__search == loading ***');
|
||||
@@ -157,9 +172,11 @@ $: if ($events_trigger == 'load__event_badge_obj_li' && $events_slct.event_id) {
|
||||
api_cfg: $ae_api,
|
||||
event_id: $events_slct.event_id,
|
||||
type_code: type_code,
|
||||
fulltext_search_qry_str: search_str,
|
||||
like_search_qry_str: '',
|
||||
external_event_id: $events_loc.badges.default__external_registration_id
|
||||
fulltext_search_qry_str: ft_search_str_new,
|
||||
like_search_qry_str: lk_search_str_new,
|
||||
external_event_id: $events_loc.badges.default__external_registration_id,
|
||||
params: params,
|
||||
try_cache: false
|
||||
})
|
||||
.then(function (search_results) {
|
||||
$events_slct.badge_obj_li = search_results;
|
||||
@@ -172,16 +189,15 @@ $: if ($events_trigger == 'load__event_badge_obj_li' && $events_slct.event_id) {
|
||||
|
||||
$events_sess.status_qry__search = 'loading';
|
||||
|
||||
|
||||
console.log(search_str);
|
||||
|
||||
search_submit_results = events_func.handle_search__event_badge({
|
||||
api_cfg: $ae_api,
|
||||
event_id: $events_slct.event_id,
|
||||
type_code: type_code,
|
||||
fulltext_search_qry_str: search_str,
|
||||
like_search_qry_str: '',
|
||||
external_event_id: $events_loc.badges.default__external_registration_id
|
||||
fulltext_search_qry_str: ft_search_str_new,
|
||||
like_search_qry_str: lk_search_str_new,
|
||||
external_event_id: $events_loc.badges.default__external_registration_id,
|
||||
params: params,
|
||||
try_cache: false
|
||||
})
|
||||
.then(function (search_results) {
|
||||
$events_slct.badge_obj_li = search_results;
|
||||
|
||||
Reference in New Issue
Block a user