canot find users in translated language

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

This topic contains 21 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 3 years, 1 month ago.

Viewing 7 posts - 16 through 22 (of 22 total)
  • Author
    Posts
  • #31663
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    And 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.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #31664
    memcan71
    memcan71
    Participant

    Sorry 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.

    Attachments:
    You must be logged in to view attached files.
    #31668
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Have 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!

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #31674
    memcan71
    memcan71
    Participant

    I 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?

    #31675
    memcan71
    memcan71
    Participant

    I think I found how to do it. Thanks for your time

    #31676
    memcan71
    memcan71
    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;
    }

    #31700
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    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.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 7 posts - 16 through 22 (of 22 total)

You must be logged in to reply to this topic.