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

Reply To: Search results page sorting problem

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Search results page sorting problem Reply To: Search results page sorting problem

#29598
msamavi64msamavi64
Participant

By the way, I am using the following snippet based on your older solution to be able to search for some special characters:

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(
‘Ā’, ‘ā’, ‘Ā’, ‘ā’, ‘Ḥ’, ‘ḥ’, ‘Ḥ’, ‘ḥ’, ‘Ī’, ‘ī’, ‘Ī’, ‘ī’, ‘Ṣ’, ‘ṣ’, ‘Ṣ’, ‘ṣ’, ‘S̲’, ‘s̲’, ‘Ṭ’, ‘ṭ’, ‘Ṭ’, ‘ṭ’, ‘Ū’, ‘ū’, ‘Ū’, ‘ū’, ‘Z̤’, ‘z̤’, ‘Ẓ’, ‘ẓ’, ‘Ẓ’, ‘ẓ’, ‘Z̲’, ‘z̲’, ‘Ẕ’, ‘ẕ’, ‘ʼ’, ‘ʻ’, ‘ʹ’
);
$replace = array(
‘a’, ‘a’, ‘a’, ‘a’, ‘h’, ‘h’, ‘h’, ‘h’, ‘i’, ‘i’, ‘i’, ‘i’, ‘s’, ‘s’, ‘s’, ‘s’, ‘s’, ‘s’, ‘t’, ‘t’, ‘t’, ‘t’, ‘u’, ‘u’, ‘u’, ‘u’, ‘z’, ‘z’, ‘z’, ‘z’, ‘z’, ‘z’, ‘z’, ‘z’, ‘z’, ‘z’, ”, ”, ”
);

// 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;
}