Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › canot find users in translated language
- This topic has 21 replies, 2 voices, and was last updated 5 years, 3 months ago by
Ernest Marcinko.
-
AuthorPosts
-
February 18, 2021 at 2:07 pm #31663
Ernest Marcinko
KeymasterAnd now it is actually working as you rewritten it, see: https://i.imgur.com/MslJ9s2.png
But since the english version is in the database, that one works for searching only – the turkish version is only a string translation, that is not accessible to search unfortunately.Well, for the member types maybe using a user meta field to add the turkish text? That way the search could access them – and may even resolve the issue with searching the turkish names, since you could enter those there as well. User meta fields are great for search and can be easily accessed.
February 18, 2021 at 2:33 pm #31664memcan71
ParticipantSorry but it is not working. I have attached another ss. It is not user. It is just a page and menu item. The search doesn’t even find page contents.
February 18, 2021 at 3:20 pm #31668Ernest Marcinko
KeymasterHave you selected the appropriate post types under the General Options -> Sources panel?
If so, I can take a look at your configuration if you want to. There are at least a dozen of things that can prevent results from appearing – wrong filters, wrongly configured exclusions etc.. Feel free to add temporary FTP and back-end details, and I will take a look. Thank you!February 18, 2021 at 7:26 pm #31674memcan71
ParticipantI have installed advanced custom fields plugin but I am not sure how to add user meta fields. Can you let me know how should I add those meta fields?
February 18, 2021 at 7:47 pm #31675memcan71
ParticipantI think I found how to do it. Thanks for your time
February 18, 2021 at 8:38 pm #31676memcan71
ParticipantI 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;
}February 19, 2021 at 4:09 pm #31700Ernest Marcinko
KeymasterHi,
Yes, the issue with that is, the custom code replaces the ‘ı’ with “i” and therefore it does not work. However if you remove the custom code it will not work the other way around. Try it without the custom code first, to see how that changes, but it might get even worse. It is very unfortunate that the database cannot treat those characters as same collations.
-
AuthorPosts
- You must be logged in to reply to this topic.