shopp_index_stopwords

filters the search indexing stopwords list.

add_filter( 'shopp_index_stopwords', [callback] )

@param array $stopwords the search indexing stopwords list

Description

filters the search indexing stopwords list.

This array of terms are removed from the indexing of products in the search index table, because they would create irrelevant search hits.

Example

// register filter callback
add_filter('shopp_index_stopwords', 'shopp_index_stopwords_filter');

// create filter function
function shopp_index_stopwords_filter( $stopwords ) {
    // default stop words
    $stopwords = array(
        'a', 'an', 'and', 'are', 'as', 'at', 'be', 'but', 'by',
        'for', 'if', 'in', 'into', 'is', 'it',
        'no', 'not', 'of', 'on', 'or', 'such',
        'that', 'the', 'their', 'then', 'there', 'these',
        'they', 'this', 'to', 'was', 'will', 'with'
    );

    return $stopwords;
}

See Also

You must be logged in to post a comment.

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

Skip to toolbar