This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: canot find users in translated language

Home Forums Product Support Forums Ajax Search Pro for WordPress Support canot find users in translated language Reply To: canot find users in translated language

#31676
memcan71memcan71
Participant

I solved the problem with custom fields but I have problem with the letter “ı” in turkish. The keyword is “Kadın” and the search brings results if I write “kad” but if I add “ı” it says no results. I think this is a problem related to the character.

You had previously sent the following code but it does not help. I would appreciate your help.

add_filter(‘asp_indexing_string_pre_process’, ‘custom_chars_asp_indexing_string_pre_process’, 10, 1);
add_filter(‘asp_search_phrase_before_cleaning’, ‘custom_chars_asp_indexing_string_pre_process’, 10, 1);
add_filter(‘asp_query_args’, ‘custom_chars_asp_indexing_string_pre_process’, 10, 1);
function custom_chars_asp_indexing_string_pre_process($s) {
$original = array(
‘ı’, ‘ī’, ‘ʻ’, ‘ā’, ‘Ṭ’, ‘ṣ’, ‘ū’
);
$replace = array(
‘i’, ‘i’, ”, ‘a’, ‘t’, ‘s’, ‘u’
);

// Replace them
if ( is_array($s) ) {
if ( isset($s[‘s’]) && !$s[‘_ajax_search’] )
$s[‘s’] = str_replace($original, $replace, $s[‘s’]);
} else {
$s = str_replace($original, $replace, $s);
}

return $s;
}