• Resolved sandraculi

    (@sandraculi)


    I’ve installed this plugin and I’ve set the plugin so it sorts the search results in order of relevance, but it still seems to prioritise published date.

    Looking at this example where I’m looking for American Pancakes, a more recent article with a week menu (including the pancakes) is still prioritised over the actual recipe:

    https://culi-sandra.nl/?s=american+pancakes

    Could you let me know how the plugin defines ‘relevance’? Thanks for your help!

    BR, Sandra

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Sumit Singh

    (@5um17)

    Hi,

    Sorry for the delay.

    Do you still have this issue?

    Thanks

    We are having a similar issue. I inherited maintenance of our website that an outside design firm created and maintained for a couple of years. That firm installed the WP Extended Search plugin which we have always had issues with how it sorted search results. I’ve gone into the WP Extended Search Settings page and changed some of the settings which has slightly improved the results.

    Our website (studio-tech.com) consists of several categories: Products (and accessories), press releases (News), Events, posts (Pages), and a list of resellers (Where to Buy). When searching we’d like the products to be listed first, followed by accessories, pages, news, and the resellers in ascending order. For example, if we search for “41” (which is one of our products, the Model 41) the first result is the Model 410, followed by the Model 5414, then the Model 41. (This has been greatly improved after I changed some settings — the Model 41 used to appear on page 3 or so.) After the Model 41 the results are listed in what seems to be a random mixture of products, pages, news, etc.

    In the Settings page under Taxonomies I checked Categories and Product Types. Search Results Order is Relevance, Ascending. These settings seem to have improved the search results. However, I do not understand Select Post Types, which has five checkboxes labeled 0, 1, 2, 3, 4. I’ve not seen this section labeled this way in any screenshots I came across while searching for help and do not know what any of it means.

    Another search results related example: on our website if I select Products then Dante Audio-over-Ethernet Technology the products are listed in a somewhat ascending order. Somewhat meaning Model 204 comes before Model 43D (because “2” is smaller than “4”). Ideally, the Model 43D would come before the Model 204 (since “43” is a smaller number than “204”). I’m not sure if there is anything within your plugin that will address this issue.

    Using the Settings is there a way to accomplish the search results order we’d prefer?

    Thank you.

    Plugin Author Sumit Singh

    (@5um17)

    Hi,

    The relevance order is WP default order. This plugin is not doing any extra work except using the WP orderby feature.

    Quoting the doc

    ‘relevance‘ – Order by search terms in the following order: First, whether the entire sentence is matched. Second, if all the search terms are within the titles. Third, if any of the search terms appear in the titles. And, fourth, if the full sentence appears in the contents.

    Ref: https://developer.www.ads-software.com/reference/classes/wp_query/#order-orderby-parameters

    Hope this helps!

    Thread Starter sandraculi

    (@sandraculi)

    Hi Sumit,

    In that case, I still don’t understand how some articles are prioritised over others? I get the logic, but it seems that the plugin doesn’t take into account how relevant an article is?

    In my example of searching for ‘American pancakes’ on my blog, the top result you get is this blogpost:
    https://culi-sandra.nl/weekmenu-14-kipschotel-traybake-american-pancakes/

    As you can see, ‘American pancakes’ is present in the title, but in the article itself it’s only mentioned 2 times.

    How can this be prioritised over the actual article about American pancakes, where the sentence is used 10 times? https://culi-sandra.nl/american-pancakes-recept-de-lekkerste/

    BR, Sandra

    Plugin Author Sumit Singh

    (@5um17)

    Hi Sandra,

    This not like that.
    As per the WP code https://build.trac.www.ads-software.com/browser/tags/5.4.2/wp-includes/class-wp-query.php#L1501 (you can read the comments in code)

    1. First match the whole sentence in title
    2. Then match the all words in title
    3. Then match the few words in title
    4. Then match the sentence in excerpt
    5. Then match the sentence in content

    In your case both the words are matched in both posts title so have equal priority then sorted again with post date and the latest is on top.

    I hope this is clear now.

    Thanks

    • This reply was modified 4 years, 7 months ago by Sumit Singh.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Searching by relevance not working’ is closed to new replies.