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 3 years, 3 months ago.
- AuthorPosts
- November 20, 2019 at 6:49 pm #24677
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?
November 21, 2019 at 11:19 am #24680Hi,
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 :)
November 21, 2019 at 5:36 pm #24704Ok 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?
November 22, 2019 at 1:21 pm #24706Hi,
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 :)
November 23, 2019 at 10:51 am #24715You cannot access this content.November 25, 2019 at 1:51 pm #24728You cannot access this content. Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
February 26, 2020 at 5:50 pm #26016You cannot access this content.February 28, 2020 at 3:30 pm #26051Hey Ernest just wanted to confirm that you received my last message! thanks!
February 28, 2020 at 4:04 pm #26052You cannot access this content. Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
February 28, 2020 at 4:26 pm #26058You cannot access this content.March 2, 2020 at 4:19 pm #26077You cannot access this content. Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
March 11, 2020 at 3:42 pm #26218forgive me what does FTP stand for? I just want to make sure I’m sending the right thing!
March 11, 2020 at 4:04 pm #26223You cannot access this content. Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
March 11, 2020 at 6:14 pm #26231You cannot access this content.March 12, 2020 at 2:04 pm #26234Hi!
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 activeI 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:
Best,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; }
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
You must be logged in to reply to this topic.