shopp_index_factors

filters the search index weight factors.

add_filter( 'shopp_index_factors', [callback] )

@param array $factors the search index weight factors

Description

filters the search index weight factors

Altering the search index weight factors will alter the quality and relevance of search hits.

Example

// register filter callback
add_filter('shopp_index_factors', 'my_filter');

// create filter function
function my_filter( $factors ) {
    // weight percentage of different product factors
    // 100 is normal weight
    // 50 is half weight
    // 200 is double normal weight
    // Below are the default weights
    $factors = array(
        'name' => 200,
        'prices' => 160,
        'specs' => 75,
        'summary' => 100,
        'description' => 100,
        'categories' => 50,
        'tags' => 50
    );

    return $factors;
}

See Also

You must be logged in to post a comment.

© Ingenesis Limited. Shopp™ is a registered trademark of Ingenesis Limited.

Skip to toolbar