WordPress.org

Ready to get started?Download WordPress

Forums

Relevanssi - A Better Search
Searching with relevanssi shows all revisions (14 posts)

  1. andydlf
    Member
    Posted 2 years ago #

    After updating Relevanssi to the newest 3.3.1 compatible version Relevanssi now shows a very extensive list of post revisions when performing a search. It's clearly not intended as these revision links end up in a blind alley so to speak.

    Please note, I am still on WordPress 3.2.1 and have not yet updated to 3.3.1 (I have my reasons). Is this a 'bug' because I'm not on the newest WordPress?

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

  2. andydlf
    Member
    Posted 2 years ago #

    I have now updated to the newest wordpress 3.3.1 and the problem persists.

  3. Mikko Saari
    Member
    Plugin Author

    Posted 2 years ago #

    Somebody complained about the same problem before; turned out they were doing something that made the revisions have the wrong post type in the database. So, check your wp_posts database: do revisions have the post type "revision"?

  4. andydlf
    Member
    Posted 2 years ago #

    Just checked, all revisions are correctly set to revision under post_type

  5. andydlf
    Member
    Posted 2 years ago #

    Maybe reinstalling Relevanssi would be worth a try then?

  6. borntohula
    Member
    Posted 2 years ago #

    Hi,

    It seems to be an issue where a custom post type has been used e.g. reviews (generated using Custom Post Type UI). The revisions aren't saved as the post type 'revision', but instead are saved as 'reviews' with a custom permalink (e.g. 4648-revision).

    Thanks

  7. andydlf
    Member
    Posted 2 years ago #

    Do you know of a fix besides disabling revisions for the post type AND deleting all previously saved database revisions?

  8. borntohula
    Member
    Posted 2 years ago #

    I've hacked around with the plugin and done a quick fix. This fix may break some of the other functionality though, so use at your own risk.

    In the relevanssi_build_index (around line 2085) function you'll find the following twice:

    AND (
        (post.post_status='inherit'
        AND post.post_parent=parent.ID)
        OR
        (parent.ID=post.ID)
    )

    Replace with:

    AND (parent.ID=post.ID)

    Then try rebuilding a portion of the index.

  9. Mikko Saari
    Member
    Plugin Author

    Posted 2 years ago #

    That's a good fix, yes. It'll break indexing attachments, but if you don't care about attachments, that's not going to hurt.

    I'll see about fixing this for good in the next version.

  10. borntohula
    Member
    Posted 2 years ago #

    Thanks msaari. I'd normally write something a bit more robust, but it was required on a small project with no budget :)

  11. Mikko Saari
    Member
    Plugin Author

    Posted 2 years ago #

    Borntohula, I tried to reproduce the problem, but when I added revision support to my post type, the revisions do have a post_type of 'revision'.

    Can you show me the code you use to register the post type? Could some other plugin be messing with this?

  12. borntohula
    Member
    Posted 2 years ago #

    Hi,

    There's a good chance that a plugin is interfering, but at the mo I don't have the time on the project. In the next couple of weeks I'll have some time, so will message back in here what the possible issues could be.

    Thanks

  13. rlgrobert
    Member
    Posted 2 years ago #

  14. borntohula
    Member
    Posted 2 years ago #

    Good find!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags