User not appearing in search

Home Forums Product Support Forums Ajax Search Pro for WordPress Support User not appearing in search

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

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #24677
    spiritedsmoke56
    spiritedsmoke56
    Participant

    There is a user on our site “Adam Eccleston” who will not appear in search results. We are searching by display name, {first_name} and {last_name} so I would expect that if you search for “Adam Eccleston” or “Adam” or “Eccleston” his name would appear, but he does not. I have tried searching with logic settings both OR and AND. I can not figure out what to manipulate to get him to appear in search results. I am concerned that this issue might appear when searching for other users as well. Can you help?

    #24680
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    It is due to an internal limitation (performance reasons), where the keyword logic applies to the whole of the field, and not the individual fields. It is possible to bypass that limit with a small custom code snippet. That should resolve the issue.

    To add the bypass, please add this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!

    add_action('asp_query_args', 'asp_query_args_meta_changes');
    function asp_query_args_meta_changes($args) {
      $args['user_search_meta_fields_separate_subquery'] = 1;
      return $args;
    }

    If you need help with it, you can add temporary FTP details, and I will do it for you.

    Best,
    Ernest Marcinko

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


    #24704
    spiritedsmoke56
    spiritedsmoke56
    Participant

    Ok that kind of worked. Now that we;ve put the code in, if I search “Eccleston” he will appear in searches. But if I search by “Adam” or “Adam Eccleston” he does not appear. Anything else we can try?

    #24706
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    That is interesting, I am pretty sure that should work. Can you please add temporary FTP details as well? I would like to directly modify the plugin code to debug the query, to see what is wrong there.

    Best,
    Ernest Marcinko

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


    #24715
    spiritedsmoke56
    spiritedsmoke56
    Participant
    You cannot access this content.
    #24728
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

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


    #26016
    spiritedsmoke56
    spiritedsmoke56
    Participant
    You cannot access this content.
    #26051
    spiritedsmoke56
    spiritedsmoke56
    Participant

    Hey Ernest just wanted to confirm that you received my last message! thanks!

    #26052
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

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


    #26058
    spiritedsmoke56
    spiritedsmoke56
    Participant
    You cannot access this content.
    #26077
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

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


    #26218
    spiritedsmoke56
    spiritedsmoke56
    Participant

    forgive me what does FTP stand for? I just want to make sure I’m sending the right thing!

    #26223
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

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


    #26231
    spiritedsmoke56
    spiritedsmoke56
    Participant
    You cannot access this content.
    #26234
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    Thank you very much, I was able to fix the issue.

    There were two problems:
    1. The code was incorrect, I made a mistake
    2. The code was not active, since the child theme is not active

    I corrected the code, and put it into the active theme directory functions file instead of the child theme file.

    For future reference, the corrected version is:

    add_filter('asp_query_args', 'asp_query_args_meta_changes', 10, 1);
    function asp_query_args_meta_changes($args) {
    	$args['user_search_meta_fields_separate_subquery'] = 1;
    	return $args;
    }
    Best,
    Ernest Marcinko

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


Viewing 15 posts - 1 through 15 (of 15 total)

You must be logged in to reply to this topic.