Support » Plugin: Relevanssi - A Better Search » [Plugin: Relevanssi – A Better Search] Search subcategories

  • Great search plugin. Loving the search weighing, a lot more accurate than default WP search.

    However, I’m having trouble to make it search certain categories. With default WP search when I add a param ‘cat=11’, it will search category id 11 and all its children. But this plugin doesn’t search the subcategories.

    My temporary workaround is to add all the subcategories too to the param, but this makes the URL very long. And when I create a new category, I have to edit the code again.

    Please add this to the next version. Or let me know if there’s a code snippet that I can add to enable this. Thanks.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Mikko Saari


    I can change the default behaviour to include subcategories, if that’s the default in WordPress.

    Thank you 🙂

    Plugin Author Mikko Saari


    Version 2.7.5 will search subcategories (all child categories and grandchildren up to as many levels as you have).

    msaari, this feature isn’t exactly working me. I’m running version 2.8.1 on WP 3.1.2.

    So I have a main category, Resources, and a child category, Articles, which has several child-categories as well. All of the posts are attached to only Articles’ child categories.

    When I restrict the search to the Resources category, several results will show up. If I restrict the search to the Articles category, no results are found, when I know there should be results.

    If I deactivate Relevanssi, and do the same search restricted to the Articles category, results are returned.

    Any idea why this would be happening? Any possible solutions?

    Thanks! And love the plugin, btw!

    I did some more testing. I added a new third level category, ie. Resources -> Research -> Studies. I added a post with only the Studies category selected.

    When I search for that post, the post only displays when I have no category selected in the search or when I have the Studies category selected. Now if the Resources category is selected, or the Research category is selected during search, the post will not be found.

    So all in all, I’m getting inconsistent results when it comes to searches and child categories.

    Plugin Author Mikko Saari


    Sorry, can’t reproduce this. On my test blog, I find the post on the third level, no matter which category I specify in the search.

    The category search is based on WordPress core functions (get_term_children()), so I don’t really have an idea why it wouldn’t work.

    Would it make any difference if the third level categories existed before the second level?

    I recently added the Articles category and made several categories that were 2nd level (children of resources) children of Articles – making them 3rd level. All of the posts were published before the Articles category existed. That is the only thing I can think of.

    Like I said, with the normal WordPress search I get results when restricting the search to the Articles category. The Articles category archive shows all the posts from the 3rd level categories.

    Plugin Author Mikko Saari


    Nope, that doesn’t make any difference, I tried it.

    Hmmm, not sure what exactly was causing my issue. But I exported all of my content and imported into a fresh WordPress install and everything works as expected.

    Thanks again for this great plugin.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: Relevanssi – A Better Search] Search subcategories’ is closed to new replies.