• Resolved pixeltokig

    (@pixeltokig)


    Really good plugin! Thanks a lot!

    We have a search field which searches a custom post type. We use ACF Pro a lot and this custom post type has around 10 ACF Pro fields which Relevanssi also successfully index after we have set the setting “Custom fields to index” to “all”.

    Relevanssi index everything successfully but when I for example search for the word “sky” the custom post type with the post title that has the word “sky” in it is not in the top results.

    We want Relevanssi to weight the post titles very high, but be still able to index ACF Pro fields in case the search word is not in a post title.

    You can see here https://foxdesign-staging.pixeltokig.se/sokresultat?_sf_s=sky&post_types=product. Try to search for the word “sky” and you will see that the post with the title “Sky park” not showing up in the top results.

    Thanks a lot in advance!

    Kind regards, Christoffer

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

    (@msaari)

    If you want title matches higher up in the results, just increase the title weight in Relevanssi settings until you find the results pleasing. It will not affect the way ACF fields are indexed.

    Thread Starter pixeltokig

    (@pixeltokig)

    Thanks for the quick reply!

    I tried to set the weight for post title to 20 and keep the rest (comments, author and category) to the value of 0.75. Then I re-indexed it and tried but nothing seemed to change. We have no cache on this site yet.

    Do you know of anything else that can effect the results?

    Thanks again!

    Kind regards, Christoffer

    Plugin Author Mikko Saari

    (@msaari)

    Set it to 200, and if that does nothing, then your search results are not actually powered by Relevanssi but something else.

    That search seems to be finding more results than it should – by default Relevanssi doesn’t match “sky” to “Bl?ndskydd”, for example. Have you changed the fuzzy search matching method to match inside words? This looks more like Relevanssi results.

    Thread Starter pixeltokig

    (@pixeltokig)

    It worked! I increased the weight to 200 and now the titles are at the top results.

    Thanks a lot!

    Hi. I’m finding the same ‘sort by title’ issue (although I’m not using ACF). I have tried increasing the title weight to 200, 300, 1000 etc but no change. See https://www.allisport.com/search/?q=puma%20td4%20early

    You’ll see that searching for ‘puma td4 early’ finds 1 match at the top, but the other product containing all 3 words is bottom of page 2. I have worked out that this is because the one on page 2 was published in 2012 as opposed to the one on page 1 that is 2017. If I am ordering by relevance and have the Post Title weight so high, should it still account for the publish date so heavily?

    .

    • This reply was modified 7 years, 3 months ago by stowbee.
    Plugin Author Mikko Saari

    (@msaari)

    @stowbee, please start a new topic. This is buried on the second page of forum posts, and I very rarely look at the second page. I check the first page daily, so you’re guaranteed much faster answers.

    This may be related to a bug in Relevanssi. In that case, adding this code to your theme functions.php might help improve the results:

    add_filter('relevanssi_modify_wp_query', 'rlv_remove_meta_query', 999); 
    function rlv_remove_meta_query($query) { 
    $query->query_vars['meta_query'] = null; 
    $query->meta_query = null; 
    return $query; 
    }

    Publication date, by default, doesn’t affect the results at all. Since the post content is pretty much the same, they should rank equally. Can you enable the “Search results breakdown” and report what kind of relevancy scores those posts get?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How to increase weight for post titles when using ACF’ is closed to new replies.