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 6 years, 1 month ago.
- AuthorPosts
- August 17, 2017 at 6:29 pm #14364
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!
DarleneAugust 18, 2017 at 8:36 am #14369Hi 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.pngTaken 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 :)
August 19, 2017 at 4:52 pm #14389Hi 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,
DarleneAugust 23, 2017 at 3:26 am #14451Hi Ernest,
Just following up to see if you had any further suggestions.
Thank you,
DarleneAugust 23, 2017 at 12:37 pm #14454Hi 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 :)
August 24, 2017 at 2:21 am #14472You cannot access this content.August 24, 2017 at 10:23 am #14477Hi 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 :)
August 26, 2017 at 3:33 pm #14524Yes, works great now. Thank you!
Darlene
August 28, 2017 at 10:36 am #14530You cannot access this content. Best,
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.