Recent

better_search_query_recency_sqlfilterPro only

better_search_query_recency_sql

Filter the recency decay multiplier applied to the relevance score in ORDER BY.

Return an empty string to disable the boost for this query.

Type: filter
Since: 4.5.0
Source: includes/pro/class-query-modifier.php line 235

Parameters

Type Name Description
string $sql The multiplier SQL, or an empty string when inactive.
string $date_column The UTC date column the decay is measured from.
float $weight Recency boost percentage.
float $halflife Half-life in days.
array $args Query arguments.

Usage

add_filter( 'better_search_query_recency_sql', function($sql, $date_column, $weight, $halflife, $args) {
    // ...
    return $sql;
} );