• Resolved jamesdonegan

    (@jamesdonegan)


    Hoping you can help … I appreciate that Relevanssi focuses on keywords, but for some reason it puts words out of order, including in the title.

    I am working on a client’s site who sells industrial pumps using Woocomemrce.
    Let’s take as an example a product called “Silicone Free Pump.”
    When I search “silicone free” it returns a TON of results, but none of them is the product “Silicone Free Pump.” So I went to the Debugging pane, and it shows the post title as “free pump silicone.” I think because it puts them in alphabetical order as keywords, but it’s wrecking my results.

    I’m giving a boost to exact matches, but how can there be exact matches when the string doesn’t exist in the index?

    I have posted the link to the search results above … you can see that it seems to show everything in the whole site.

    • This topic was modified 3 years, 2 months ago by jamesdonegan.

    The page I need help with: [log in to see the link]

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

    (@msaari)

    The Silicone Free Pump post does appear in the results.

    What you’re seeing in the debugger is perfectly normal. Relevanssi stores individual words in the index, and the debugging page just presents them in the alphabetical order, because Relevanssi does not know the original order.

    When doing a search, Relevanssi breaks up the search query and searches for individual words. When doing exact phrase matching, Relevanssi compares to the original post content, which has the original words.

    If you want to find a specific phrase, you can put in quotes. If you search for "silicone free pump", you’ll find that post and only that post.

    Also, it looks like your search results are shown in the alphabetical order. If you search using the Relevanssi admin search (Dashboard > Admin search), you can see the exact scores Relevanssi calculates for your posts. Does the Silicone Free Pump post get the best score? It should, especially if you’re using the exact match boost. However, if the results are shown in alphabetical order, a good score does not help.

    I tried forcing relevancy score order, but that didn’t work. Something is heavily overriding the order of the results. You can see if adding this to theme functions.php helps:

    add_filter( 'relevanssi_modify_wp_query', 'rlv_order' );
    function rlv_order( $query ) {
        $query->set( 'orderby', array( 'relevance' => 'desc' ) );
        return $query;
    }
    Thread Starter jamesdonegan

    (@jamesdonegan)

    Very helpful, thank you. There was a residual function from an old theme that I didn’t notice (slipped through when I was retheming the site). Thank you so much.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Words out of order in debug search’ is closed to new replies.