andydlf
Member
Posted 3 months 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/
andydlf
Member
Posted 3 months ago #
I have now updated to the newest wordpress 3.3.1 and the problem persists.
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"?
andydlf
Member
Posted 3 months ago #
Just checked, all revisions are correctly set to revision under post_type
andydlf
Member
Posted 3 months ago #
Maybe reinstalling Relevanssi would be worth a try then?
borntohula
Member
Posted 3 months 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
andydlf
Member
Posted 3 months ago #
Do you know of a fix besides disabling revisions for the post type AND deleting all previously saved database revisions?
borntohula
Member
Posted 3 months 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.
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.
borntohula
Member
Posted 3 months ago #
Thanks msaari. I'd normally write something a bit more robust, but it was required on a small project with no budget :)
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?
borntohula
Member
Posted 2 months 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
rlgrobert
Member
Posted 2 months ago #
borntohula
Member
Posted 2 months ago #