Relevance Weighting
-
Two questions
1. What are default relevance numbers for Title, Content, SKU, Short Description, Category and Tag out of the box?
2. I was provided this code to add more relevance to words in Product Title but its not working. When i add this code no products are found at all. Is this incorrect?
add_filter( ‘aws_search_query_array’, ‘my_aws_search_query_array’ );
function my_aws_search_query_array( $query ) {
$relevance = “( case when ( title = ‘meta_artist_name’ ) then 500 else 0 end ) +”;
$query[‘relevance’] = preg_replace( ‘/\(SUM\([\s\S]*?\([\s\S]*?case[\s\S]*?end[\s\S]*?\)[\s\S]*?\+/i’, ‘$0’ . $relevance, $query[‘relevance’] );
return $query;
}
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Relevance Weighting’ is closed to new replies.