Search Filters not Functioning

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Search Filters not Functioning

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

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #17468
    mbaker
    mbaker
    Participant

    Hello,

    I have set 5 category filters (from post categories) that I believe would be most used by my users. Unfortunately, when I select a filter and attempt to search for something within that filter, I am still see all site results as if I hadn’t even select a filter. Is there a setting I am missing that is needed to enable the use of the filters?

    I have placed my search bar on this page that you can test: http://new.aspenxchange.com/

    Thank you

    #17474
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    I haven’t been able to log-in with the details, but I think I know what you are looking for.

    By default, the plugin does not exclude items, that does not belong to any category/term, as those have no connection to the filter itself.
    You can change that (an other things as well) on the Frontend search settings -> Andvanced panel: https://i.imgur.com/AwfGVq1.png

    Best,
    Ernest Marcinko

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


    #17478
    mbaker
    mbaker
    Participant
    You cannot access this content.
    #17481
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Thank you for that.

    Okay, I checked your configuration, and the issue is a bit more complicated than that. I did not know this is actually a multisite installation, and you have lot of sites selected as the source. There are also some categories excluded under the Advanced Options -> Exclude results panel.

    I believe the cause of the problem are these excluded categories, for some reason those conflict with the filter. I am not sure which one it is, but when I removed them, it started showing results. I guess there is either an ID conflict, or something I am not aware of yet.

    Generally, it is not a good idea to use exclusions/filters when searching multiple multisie blog contents, as those categories does not exist on different sites, and may lead to conflicts.

    I have found a possible working configuration:
    – Try changing the Frontend search settings -> Andvanced like this: https://i.imgur.com/m7EPyhX.png
    – And remove the exclusions, as probably one of them has a false effect: https://i.imgur.com/WX4HMzU.png

    Now this configuration will have the filter active, only when at lease one item is selected, probably giving the best possible results.

    Best,
    Ernest Marcinko

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


    #17482
    mbaker
    mbaker
    Participant

    Hello,

    Thank you for your response.

    Unfortunately, I need those exclusions there because they are identifying confidential information specific to certain clients that I can’t have appearing in my search results. However, if multisite is what is causing the conflict with the exclusions, I believe I can remove the multisite functionality.

    Each of my sub domains (sites within multisite) are simple one-page sites. So to make these more searchable, I created a post for each sub domain that will automatically redirect to the sub domain when clicked from the main site. Each post is tagged with keywords that relate to content on it’s related sub domain so essentially I’ve set it up so that my sub domains are all searchable within my main site through posts. Because of this, I think I should be able to remove the multisite functionality without compromising the search ability of those sites. Does that sound like it might work the way I think it would?

    I tested this by removing all of the blogs from the multisite settings and leaving only the main site. After saving and testing the search again, I am still not receiving any results for search terms I know are tied to specific posts.

    Is there a setting I am missing that would allow me to entirely disable the multisite settings that could still be causing this issue?

    Best,

    #17483
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    I don’t think you should do that, as I am not entirely sure if that is the cause.

    I did a few more experiments, and whenever an exclusion is made for a separate taxonomy (not category), then simply everything is excluded. I am not sure if this is an exception of some sort, or perhaps a yet unkonw bug.

    Anyways, I have constructed a custom code, that may get around it. This script will turn on/off the empty taxonomy argument, depending if there is anything selected within the filter. Basically, by default it will allow searching everything (except the exclusions of course), then when any checkbox is checked, it won’t allow the missing terms option. I am almost certain that this should get around the issue.

    Add this custom code to the functions.php in your theme/child theme directory (copy from line 3 only!). Before editing, please make sure to have a full site back-up just in case!

    Best,
    Ernest Marcinko

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


    #17484
    mbaker
    mbaker
    Participant

    Hi,

    I’ve implemented the custom code you provided into my functions.php file and unfortunately it doesn’t seem to have had an effect.

    Please let me know what you think the next step should be. I appreciate your time.

    Best,

    #17485
    mbaker
    mbaker
    Participant

    I apologize, I responded too quickly.

    With your custom code implemented, it is now allowing results to appear when a filter selection is not made. Once I select a filter and enter a search term, that I know is used as a tag on content in that filter, it is still not showing any results.

    Hopefully this helps you identify the issue with the filters.

    Best,

    #17486
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Well, that didn’t work, I am probably missing something there, but I don’t know what exactly.

    Can you add temporary FTP access, so I could debug the search query, and make changes to this code in the theme functions.php file? I might be able to figure it out.

    Best,
    Ernest Marcinko

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


    #17487
    mbaker
    mbaker
    Participant
    You cannot access this content.
    #17488
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    That is a clever solution. Unfortunately I can’t see that menu, I think my account does not have priviliges to it. Can you please check that as well?

    I will try avoiding using the FTP, unless neccessary. The Snippets plugin might be sufficient.

    Best,
    Ernest Marcinko

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


    #17489
    mbaker
    mbaker
    Participant

    You should have access to that plugin now.

    #17490
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Thank you! I think I got it. I had to make a modification to the code. Now I am seeing post results whenever I am clicking a filter, nothing else. If nothing is checked, then it searches everything it should.

    For future reference, the mofified solution is this:

    Best,
    Ernest Marcinko

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


    #17491
    mbaker
    mbaker
    Participant

    Fantastic, it is working wonderfully. Thank you

    Because of the custom code, are there any settings I should not alter withing the search instance settings?

    Thank you for solving this!

    #17492
    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 :)


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

You must be logged in to reply to this topic.