WordPress.org

Ready to get started?Download WordPress

Forums

Relevanssi - A Better Search
[resolved] post_type=page shows also posts - bug in new version (13 posts)

  1. maorb
    Member
    Posted 2 years ago #

    I just upgraded Relevanssi from 2.9.9 to 2.9.14 and I encounter a bug in functionality.
    I had a search with query parameters, i.e -
    http://mydomain.com/?s=pharse&post_type=page&orderby=post_date&order=desc

    This showed the results for pages only, as expected.
    Now, after upgrading to 2.9.14, the same url shows also posts in the result, and not only pages.
    Is this a known issue that can be fixed?

    Thanks for your quick response.

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

  2. maorb
    Member
    Posted 2 years ago #

    Update:
    If using -
    http://mydomain.com/?s=pharse&post_type=post&orderby=post_date&order=desc

    It will show ok - only posts and no pages in results, but with parameter post_type=page - it shows both pages and posts in the search results.

  3. Mikko Saari
    Member
    Plugin Author

    Posted 2 years ago #

    That's actually a WordPress "feature", and shouldn't be specific to 2.9.14. Basically, WordPress won't allow you to do that. Anyway, there's a solution - change "post_type" to "post_types", and it should work.

  4. maorb
    Member
    Posted 2 years ago #

    Well, it is working as expected with "post_type" parameter on WP3.31 and Relevanssi 2.9.9, so I thought it is some change in Relevanssi.
    I will try to change "post_type" to "post_types" and see how it works.

  5. Mikko Saari
    Member
    Plugin Author

    Posted 2 years ago #

    Hmm, strange, but then again, it's four versions between those so yeah, I suppose something might've changed in between. But 'post_types' should definitely work.

  6. maorb
    Member
    Posted 2 years ago #

    I checked it, but unfortunatelly, when I use GET parameter like you suggested - 'post_types=page' it returns no results at all.
    As I wrote before, using 'post_type=page' does show results, but for both pages and posts.

  7. Mikko Saari
    Member
    Plugin Author

    Posted 2 years ago #

    Hard to say - for me post_type=page shows wrong results (because WordPress silently changes the 'page' to 'any'), but post_types=page works just as expected.

  8. maorb
    Member
    Posted 2 years ago #

    What else could it be?
    It is very weird, since WP3.3.1 with Relevanssi 2.9.9 works great for me, with post_type=page
    Only after upgrading Relevanssi to 2.9.14 the issue occured, and with 2.9.14 neither post_type=page nor post_type=pages shows expected results.
    What could it also be?
    Nothing else was changed in that site, so I assume it must be something that changed from 2.9.9 to 2.9.14, I just can't figure out what could else I can check.
    Any more advises?
    Many thanks

  9. Mikko Saari
    Member
    Plugin Author

    Posted 2 years ago #

    Sorry, no idea.

  10. maorb
    Member
    Posted 2 years ago #

    So do you say the only way to keep the functionality working is no updating Relevanssi anymore and stay with 2.9.9 , where it works?

  11. Mikko Saari
    Member
    Plugin Author

    Posted 2 years ago #

    Well, the other option is to find out why it's not working on your site - as it certainly should work (at least using post_types). Are you sure you tried "post_types=page" and not "post_type=pages"?

  12. maorb
    Member
    Posted 2 years ago #

    Yes, I'm sure it is "post_type=page" and I re-checked again.

    If you would like to see this, I'd be very happy to send you by mail a link and credentials to view the site on QA server so you would see the issue and test it.
    You may send me your mail to maor[at]maorb.info
    (I just don't want to write this credentials here in the forums, since it's a QA site that should not be linked public. )

    Thanks for your patience.

  13. maorb
    Member
    Posted 2 years ago #

    Thank you very much @msaari for your quick and accurate help by mail.
    I did have some condition in my search.php file for GET post_type that in first time I didn't notice.
    So now it's working well again, you rock!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags