Creating a general search bar with specific filter by categories

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Creating a general search bar with specific filter by categories

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

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #39220
    sdd01
    sdd01
    Participant

    Hi! I created a general search bar so It can search everything in the website. I was trying to use the Filter by category (added all the site’s categories) and also added the Advanced Options > exclude/include > Include all the categories from the filter by category

    When searching for a specific category, it appears at least 7-8 posts that don’t belong to the category first and then after scrolling down the posts pertinent to that category

    How to check the category and display only the posts pertinent to that specific category?

    https://ibb.co/f1dbyyD
    https://ibb.co/n7F2zgJ
    https://ibb.co/BVqQ9PJ

    #39230
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Try turning OFF this option: https://i.imgur.com/eksNvUO.png
    That will prevent displaying items, which have no assigned elements from the given taxonomy.

    Best,
    Ernest Marcinko

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


    #39235
    sdd01
    sdd01
    Participant
    #39237
    sdd01
    sdd01
    Participant

    Any update here?

    #39238
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    I’m so sorry, I actually answered, but something happened to my browser and it did not send the message.

    Can you please remove the post type inclusions: https://ibb.co/BVqQ9PJ
    That will mix up with the filter, and include items from those categories as well.

    If you don’t get any results afterwards, then also try changing the checkbox logic like so: https://i.imgur.com/zsx2oT9.png

    Best,
    Ernest Marcinko

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


    #39242
    sdd01
    sdd01
    Participant

    Hi! No problem!

    I did that and the search bar is in a loop of infinite search and loading….

    https://ibb.co/D5xdHRg

    It works after loading for some time… I will check my server resources and see if that’s affecting the search bar!

    Can you clarify what is the advantage of using the Include posts by taxonomy? It should only be used for a specific category right? not for the whole site?! I’m so confused lol

    • This reply was modified 6 months, 1 week ago by sdd01 .
    #39250
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    May I take a look at this somewhere?

    Using the inclusion option is to restrict the results to those categories only. However if you are using the search filters, that will already do the same thing – restrict to the selected categories. To get the best performance, I only recommend using one or the other.

    Best,
    Ernest Marcinko

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


    #39431
    sdd01
    sdd01
    Participant
    You cannot access this content.
    #39474
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    That looks as if the search process is stuck somewhere.

    Do you use post exclusions or inclusions by taxonomies? If so, are there many categories excluded/included?
    Can you try removing the exclusions, to see if that makes any difference.

    I also recommend to check this documentation for performance optimization tricks. I highly recommend using the index table engine.

    Best,
    Ernest Marcinko

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


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

You must be logged in to reply to this topic.