Weight results

This topic contains 1 reply, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 7 years, 11 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #9678


    First let me tell you about the problem I’m trying to solve. This site is for teen pregnancy prevention and STIs. We have several articles that the AJAX search is using as a source. They are framed more as a question and are typically around specific scenarios vs being broad.

    I am anticipating users of the site, teens, to be very direct in their searches, i.e. “Am I pregnant,” “Do I have an STI,” etc.

    So what I’m trying to do is weight some of our articles so they pop to the top when certain phrases are searched.

    In the WP page editor there’s a field at the bottom for “Custom suggested phrases for this post (comma separated)” This would seem to be what I’m looking for, but after testing it out it does’t seem to have changes the weighting of the answers.

    You can find one of the pages I want to add some weight for “am I pregnant” here: http://tpb.mhaze.net/wp-admin/post.php?post=134&action=edit

    Can you help me figure this out?

    Ernest Marcinko
    Ernest Marcinko


    The “Custom suggested phrases for this post” is a different option, it’s used to display different suggested phrases on a post basis.

    Solution 1: Priorities submenu

    The best way to prioritize certain results over others, is to use the result priorities submenu. However this is a global priority option, it does not take the entered search phrase into account.
    I’m planning to design such a feature in a future release, but there are a few performance related problems with it yet.

    Solution 2: Index table engine

    Another possibility is to perhaps trying the index table engine instead of the default (regular). It takes a bit of time to configure correctly, but it’s designed in a way that it calculates relevance based on word occurence and relevance values. Before anything, please read the manual on the index table engine:

    Additionally to the configuration, in this case I would do the following:

    • Create a custom field for each post, for example search_keywords and enter relevant words there as well separated by space: https://i.imgur.com/rOlRqSu.png
    • Then on the Index Table options submenu select that custom field to be indexed as well: https://i.imgur.com/O4fGMpd.png
    • On the search instance options Relevance Options -> Index table engine panel, I would increase the Custom Field relevance to 100: https://i.imgur.com/cMAmawa.png – Meaning that the word matches for the custom field created will be far more important than the other fields.

      In this case the words from the custom field are indexed as part of the post. Then when the search phrase matches a word from that field, it’s relevance will be much higher, therefore moved upwards in the results list. Since the occurence is a factor in this case, you can try a number even higher than 100 if the result is still not high enough.

      Additional option for both solutions

      One of the most efficient ways to improve the overall search experience is to change the search keyword logic: https://goo.gl/Cu5Egs
      By default the “OR” logic is used, meaning: “Match is found if any of the search keywords is part of the content.”
      Changing that to for example “AND” can give you much relevant results. It’s definitely worth a try.

    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.