WordPress.org

Ready to get started?Download WordPress

Forums

Relevanssi - A Better Search
Search subcategories (10 posts)

  1. tekoteko
    Member
    Posted 3 years ago #

    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.

    http://wordpress.org/extend/plugins/relevanssi/

  2. Mikko Saari
    Member
    Plugin Author

    Posted 3 years ago #

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

  3. tekoteko
    Member
    Posted 3 years ago #

    Thank you :)

  4. Mikko Saari
    Member
    Plugin Author

    Posted 3 years ago #

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

  5. anpsince83
    Member
    Posted 2 years ago #

    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!

  6. anpsince83
    Member
    Posted 2 years ago #

    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.

  7. Mikko Saari
    Member
    Plugin Author

    Posted 2 years ago #

    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.

  8. anpsince83
    Member
    Posted 2 years ago #

    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.

  9. Mikko Saari
    Member
    Plugin Author

    Posted 2 years ago #

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

  10. anpsince83
    Member
    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags