API Reference / API Parameters / sumOrFiltersScores
Type: boolean
Engine default: false
Parameter syntax
'sumOrFiltersScores' => true|false

Can be used in these methods:

About this parameter

Determines how to calculate the total score for filtering.

When using filter scoring to rank filtered records, you can control how scores are calculated.

Usage notes

  • This feature only applies to OR boolean operators in your filters (ie. not AND).

  • When sumOrFiltersScores is false, max score will be kept.

  • When sumOrFiltersScores is true, score will be summed.

  • Just to be clear: False means that the total score of a record is the maximum score of an individual filter. Setting it to true changes the total score by adding together the scores of each matched filter.

Examples

Apply optional filters on a search query

1
2
3
$results = $index->search('query', [
  'sumOrFiltersScores' => true
]);
Did you find this page helpful?