• Resolved mcbsys

    (@mcbsys)


    Using Ivory Search 4.4 standard on WordPress 5.2.3. Search results are often not in date order. For example, searching for “security” lists three ancient posts with “Security” in their title before many more recent posts with “security” in the body:

    https://www.mcbsys.com/?s=security

    I see the plugin default is supposed to be Date Descending, which is what I need. How do I get that? Is this some underlying WordPress behavior that I need to customize?

    Thanks,

    Mark

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Vinod Dalvi

    (@vinod-dalvi)

    I hope you are well today and thank you for your question.

    The issue is resolved in the latest released plugin version 4.4.1 so please update the plugin to the latest version and let me know how it works for you.

    Best regards,

    Thread Starter mcbsys

    (@mcbsys)

    Vinod,

    Thanks for your reply. I updated to 4.4.1, but nothing changed. Posts with the search word in the title are still sorted above other posts.

    It looks like it is the same at your site. Search https://ivorysearch.com/documentation/ for “plugin” and the articles with “plugin” in the title are listed first. (It seems all articles have the same date so it’s hard to check the sort order, but at least the title-based search seems to be in effect.)

    Regards,

    Mark

    Plugin Author Vinod Dalvi

    (@vinod-dalvi)

    The plugin used on the shared documentation page is different and not Ivory Search.

    I have tested it on my test site and it’s working fine for me using the latest version of Ivory Search plugin.

    This can be theme issue used on your site so to confirm it just temporary use the Twenty Seventeen theme on your site. If everything works fine then it’s your site theme issue.

    Thread Starter mcbsys

    (@mcbsys)

    I get the same results in a Live test with the Twenty Nineteen theme. (Note this is with Ajax off.)

    With the help of the Query Monitor plugin, I confirmed that The Main Query includes this SQL:

    ORDER BY wp_posts.post_title LIKE '%security%' DESC, wp_posts.post_date DESC

    It is the same even if I deactivate Ivory Search, so it has nothing to do with your plugin.

    I don’t know where the ORDER BY wp_posts.post_title is coming from, but I was able to override it by adding the following to functions.php in the child theme:

    function my_order_by_date_only( $query ) {
      $query->set( 'orderby', 'date' );
      $query->set( 'order', 'DESC' );
    }
    add_action( 'pre_get_posts', 'my_order_by_date_only' );

    I’ve blogged this issue here.

    Thanks for your help and for the helpful plugin!

    • This reply was modified 5 years, 2 months ago by mcbsys.
    • This reply was modified 5 years, 2 months ago by mcbsys.
    Plugin Author Vinod Dalvi

    (@vinod-dalvi)

    This can be due to any other plugin that you are using on your site.

    Awesome great to see you got the issue found and resolved it.

    Have a fantastic day!

    Thread Starter mcbsys

    (@mcbsys)

    Yeah I wondered what other plugin might be doing that. I tried disabling All-in-One SEO, probably the most aggressive plugin, but no change. I guess I could deactivate plugins until it changed, but at least it’s working for now.

    • This reply was modified 5 years, 2 months ago by mcbsys.
    Plugin Author Vinod Dalvi

    (@vinod-dalvi)

    Ok

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Incorrect sort order (not Date Descending)’ is closed to new replies.