WordPress.org

Ready to get started?Download WordPress

Forums

Relevanssi - A Better Search
Public post types don't appear in search results even wh (5 posts)

  1. Sam_a
    Member
    Posted 2 years ago #

    With Relevanssi 2.9.11, I have Respect exclude_from_search for custom post types checked and What to include in the index: All public post types selected. I save and re-index, but my public custom post types don't appear in the results.

    They do appear if I switch to What to include in the index: Everything.

    I dumped the custom post types to double check -- they have public: true and exclude_from_search: false.

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

  2. Mikko Saari
    Member
    Plugin Author

    Posted 2 years ago #

    Hmm, it should work... When set to "All public post types", Relevanssi fetches all post types that have 'exclude_from_search' set to false or 0.

    Please check your database. It's possible the posts are being indexed, but still not found in search. In order to figure out what's happening, we need to know which case this is. Take a look at wp_relevanssi and see if any of your custom posts are being indexed (the doc column is the post ID, you can use that to check).

  3. Sam_a
    Member
    Posted 2 years ago #

    Hi Mikko,

    Thanks for replying.

    With What to include in the index: All public post types selected, posts from my public custom type don't appear in the wp_relevanssi table. When I re-index with What to include in the index: Everything, they do appear.

    (Also, when Relevanssi is deactivated, my public types appear in search results as intended.)

    I'll see if I can debug anything moreā€¦ S

  4. Sam_a
    Member
    Posted 2 years ago #

    Hi Mikko,

    Around line 2006 in relevanssi_build_index(),

    $custom_types = ""

    is overwriting the value set earlier (around line 1988) when the public types are fetched.

    Here is a diff: http://pastie.org/2827788

  5. Mikko Saari
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks for spotting this. Will fix this in the next version.

    As a quick fix, the custom post type stuff is completely reworked in Relevanssi Premium and does not have this bug.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic