Search results that give most weight to one custom field
-
Hi!
I am trying to ensure that a search returns matches to a specific custom field first (created by ACF), before it returns matches from any other content areas or other custom fields. Is this possible to do this with either the free version or premium? I have added the following filter which has improved the search results (custom field matches are showing higher), but I am still seeing matches in a particular custom field come after other matches.
add_filter( 'relevanssi_match', 'rlv_customfield_boost' ); function rlv_customfield_boost( $match ) { if ( $match->customfield > 0 ) { $match->weight *= 10; } return $match; }
What do you recommend to ensure that matches to ONE custom field are at the top of the results?
Thanks!
Kasia
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Search results that give most weight to one custom field’ is closed to new replies.