Trying to limit search results to posts within a single category

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Trying to limit search results to posts within a single category

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

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #14364
    darlene003
    darlene003
    Participant

    I have 844 posts, and they are all organized by a hierarchy of 139 categories. Posts can belong to multiple categories in multiple branches, which makes it more complicated.

    I’m trying to get this search to work, but I’m having trouble because I can’t have front-end search settings that separate my categories into different criteria – it lists all 139 in one list. My understanding is that I’ll need to download a taxonomy plugin that will create separate taxonomies for each branch of my category tree – is that correct? It’s quite a daunting task with 844 posts.

    One thing that I absolutely need is to be able to limit my search to one branch of my category tree. There are multiple parents… examples are Free Content, Guests, Miscellaneous, Card Videos, Products Used, Themes, etc. I only want to search posts that are in the “Card Videos” category. This particular category has no children. However, the posts that belong to this category also belong to categories in other branches of the tree at various levels (i.e. Products Used/Distress Inks and Themes/Birthday). Belonging to the “Card Videos” category identifies these posts as videos, which is what I want the user to be searching. I hope this makes sense.

    Here is what I have setup:
    General Options/Sources – Search in Posts ON, Search in Pages OFF
    General Options/Logic and Behavior – Primary AND, Secondary DISABLED, Exact OFF
    Front End Search Settings – only Search box and Date filter are selected, with the default set to 2010 – current.
    Advanced Options/Exclude Results – the only section I changed was “Include posts (or cpt, attachments, comments) only from selected categories/taxonomy terms”. I added the “Card Videos” category to the right box.

    With these settings, when I enter a search term into the search box, it results in posts that do and do not belong to the Card Videos category. For example, I search the word “pandas”. It shows 11 posts. 8 belong to “Card Videos”, and 3 do not.

    Can you tell me what I am doing wrong? Thank you!
    Darlene

    #14369
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Darlene,

    It is possible, that items that does not belong to any given category, or does not have any associated taxonomy are showing up.
    Make sure to disable this option as well: https://wp-dreams.com/wp-content/uploads/2016/08/18/admin/9815/admin/category-include-empty.png

    Taken from this knowledge-base article: Searching within given categories/terms only

    Best,
    Ernest Marcinko

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


    #14389
    darlene003
    darlene003
    Participant

    Hi Ernest,

    I checked and the setting you suggested is already disabled (set to “off”). The results that shouldn’t be there belong to other categories.

    Any other settings I should check?

    Thanks,
    Darlene

    #14451
    darlene003
    darlene003
    Participant

    Hi Ernest,

    Just following up to see if you had any further suggestions.

    Thank you,
    Darlene

    #14454
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Darlene,

    Sorry, I have missed your ticket by accident.

    I checked to see if I can re-create this issue on my test server, but it is unfortunately working correctly there, so I’m not sure if it’s a bug or something else. Based on your description your settings sound correct to me.

    Can you please add temporary back-end and FTP details so I can check the issue directly?

    Best,
    Ernest Marcinko

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


    #14472
    darlene003
    darlene003
    Participant
    You cannot access this content.
    #14477
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Darlene,

    Thank you very much, it was indeed an issue with the plugin, as in the meantime I have recieved 2 other reports for this problem. The issue affects the last 2 releases of the plugin, but luckily can be fixed without touching the code.

    I have disabled the following option on the plugin back-end: https://i.imgur.com/8EoEpPA.png

    It should show the correct results now, sorry about the inconvenience.

    Best,
    Ernest Marcinko

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


    #14524
    darlene003
    darlene003
    Participant

    Yes, works great now. Thank you!

    Darlene

    #14530
    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 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.