• I did actually post this a while ago but it seems to have got ‘lost’ in the system. Originally when I setup the user-search function using mutlple criteria everything worked fine and dandy. As the database of users has grown the search function is now returning random results e.g. a London postcode will return 20 or so users 5 of which are in London the rest from all over the UK. The same applies to towns and so forth. This is becoming a little tiresome for members who have paid for the facility for site visitors to search for members with particular skills sets and locations. Help please!!

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Contributor etoilewebdesign

    (@etoilewebdesign)

    Without being familiar with how the UK postal code system works and without knowing exactly what value you’ve entered for each user for this postcode field, it’d be hard for us to know why it isn’t working the way you think it should be. What is an example of a value you’d put for this field for a user? What are you typing in when you search? What is an example of a postal code that is coming up in the results that shouldn’t be coming up? What’s the shortcode you are using? If you have a field named “Postcode”, for example, then the shortcode you would want to use would be:

    [user-search search_fields="Postcode"]
    
    Thread Starter bladechob

    (@bladechob)

    Typically it would be something like TN22 5AU the TN relating to postal district ToNbridge the 22 filtering to Hastings and then the 5AU to specific street area. It’s not just the Postcode working this also applies to towns/cities as well. When I first installed the premium version it all worked OK, now it doesn’t. Certain elements I’ve has to remove from the site as they don’t function properly – such as the forgot password bit as it send a link to the recipient but the fields don’t self populate and the manual pasting method is the same.

    Plugin Contributor etoilewebdesign

    (@etoilewebdesign)

    The search function is totally dependent on how you set up all your fields in the back end. So, at this point, it just isn’t clear what’s going on with your site. If you want to send us a link to your search page, tell us what to search and tell us what results are coming up that shouldn’t be and why they shouldn’t be coming up, so we can have a look, perhaps we can start again and try and understand what is working differently than you expect it to and what in your setup might be causing this.

    Thread Starter bladechob

    (@bladechob)

    Plugin Contributor etoilewebdesign

    (@etoilewebdesign)

    This looks like it could be happening because you aren’t filling in the other search fields when you do your search.

    If you remove the other search fields and put Postcode as the only search field, e.g.

    [user-search search_fields="Postcode"]
    

    does it then only find results that match what you searched?

    Thread Starter bladechob

    (@bladechob)

    Yep just having the one search field works – shame that a more filtered approach won’t do the trick but hey ho! One tiny other thing is hyperlinks in profiles – is there a way to display and enable email, websites and skype links in user profiles. I mean when someone has done a search and it returns the user data they will have emails, websites etc that ideally should just be clicked to view or use.

    Plugin Contributor etoilewebdesign

    (@etoilewebdesign)

    Thank you for confirming that it works with just the one field. That means it’s definitely working correctly. It’s just that you didn’t have it set up correctly for what you wanted. You can indeed have multiple search fields. It’s just that the search logic is set to OR by default, which means if you leave a blank field, it will return all results. If you want to only display results meeting all of the search criteria, you just need to make sure the search logic is set to AND instead of OR, i.e.:

    [user-search search_logic="AND"]
    

    As is mentioned on our plugin page and in our FAQs, and as we’ve already mentioned numerous times in one of your other threads (here: https://www.ads-software.com/support/topic/restricting-non-registered-users-to-view-a-specific-user-privaledge-level/), if you type help after any shortcode in the admin (i.e. [user-search help), it will display a list of all the available shortcodes and what they do. In that other thread, we even pasted the content of the help text that shows the search_logic attribute (here: https://www.ads-software.com/support/topic/restricting-non-registered-users-to-view-a-specific-user-privaledge-level#post-9001313).

    There’s no option to have something be clickable on the profile page. As many users wouldn’t want it for security reasons, we can’t make anything (e.g. email addresses) clickable by default. We can look into making an option to make this clickable. We can also look into adding a few more field types, like website (which could be clickable) and phone number.

    Thread Starter bladechob

    (@bladechob)

    Thank you. I’ll try this out when I’m in the office. I do know you have said about the brackets and help. It does work now on site rebuild and new server.

    Thread Starter bladechob

    (@bladechob)

    Very nice indeed adding the clickable url and phone links-works a treat! (bit of a cheek really but perhaps next WP issue an update you could also add a google search link to the post code field?). Just noticed that the shortcode attribute help is not working again either in view or text modes. Do you think this is something to do with WP updates perhaps?

    Thanks

    Plugin Contributor etoilewebdesign

    (@etoilewebdesign)

    The help still works on our end, so it could be something specific to your site (i.e. a JavaScript conflict). If you check the developer console, it should show if this is the case.

    Thread Starter bladechob

    (@bladechob)

    Interesting that. On the main WP admin page it throws back:

    load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,plupload,jquery-form&ver=4.7.5:9 JQMIGRATE: Migrate is installed, version 1.4.1
    load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,plupload,jquery-form&ver=4.7.5:3 The specified value “!” does not conform to the required format. The format is “#rrggbb” where rr, gg, bb are two-digit hexadecimal numbers.
    ja @ load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,plupload,jquery-form&ver=4.7.5:3
    n.parseHTML @ load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,plupload,jquery-form&ver=4.7.5:4
    a.fn.init @ load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,plupload,jquery-form&ver=4.7.5:9
    n @ load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,plupload,jquery-form&ver=4.7.5:2
    (anonymous) @ spectrum.js?ver=4.7.5:56
    (anonymous) @ spectrum.js?ver=4.7.5:58
    (anonymous) @ spectrum.js?ver=4.7.5:2080
    builder.js?ver=4.7.5:367 Uncaught TypeError: Cannot set property ‘post_id’ of null
    at Object.success (builder.js?ver=4.7.5:367)
    at i (load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,plupload,jquery-form&ver=4.7.5:2)
    at Object.fireWith [as resolveWith] (load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,plupload,jquery-form&ver=4.7.5:2)
    at y (load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,plupload,jquery-form&ver=4.7.5:4)
    at XMLHttpRequest.c (load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,plupload,jquery-form&ver=4.7.5:4)
    (anonymous) @ builder.js?ver=4.7.5:367
    i @ load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,plupload,jquery-form&ver=4.7.5:2
    fireWith @ load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,plupload,jquery-form&ver=4.7.5:2
    y @ load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,plupload,jquery-form&ver=4.7.5:4
    c @ load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,plupload,jquery-form&ver=4.7.5:4

    And I have no idea what this means!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘User-Search random results’ is closed to new replies.