Support » Plugin: Relevanssi - A Better Search » Mixing Relevance and Date?

  • My site ( is now using Relevanssi (and I believe we’ll be moving to Premium almost immediately once we understand everything).

    I have a few test searches I use to test things and one is giving me fits that I’m not understanding. On the site we have a number of posts with the following title:

    The Year In Movies {year}

    {year} ranges from 2007 to 2012. When I search for “the year in movies” Relevanssi shows all the 6 links first (awesome) but in a strange order of 2007, 2008, 2009, 2012, 2010, 2011.

    The post dates, of course, are all about one year apart. What can I do to get these to show up first but in the order from 2012 at the top and 2007 at the bottom?

Viewing 1 replies (of 1 total)
  • Plugin Author Mikko Saari


    If 2007 is constantly first, it’s probably the best result for that search. If you enable the “Search breakdown” option and add couple of keywords to the breakdown (%terms% and %score% are good), you’ll see why Relevanssi ranks the posts in that order. Might be the word “movies” or “year” appears more often in the 2007 post.

    If all those posts are of equal value, then the order is essentially random.

    It is possible to create a filter function that goes through the search results and if it finds those “Year in movies” posts, it orders them by date – but it gets a bit complicated soon and may make the search results worse for some cases, unless you set it up for that particular search query. And if you only set it for that query, well, just how common that query is? That is – is fixing this worth the fairly considerable effort?

Viewing 1 replies (of 1 total)
  • The topic ‘Mixing Relevance and Date?’ is closed to new replies.