API Reference / API Parameters / maxValuesPerFacet
Type: integer
Engine default: 100
Parameter syntax
'maxValuesPerFacet' => max_value

Can be used in these methods:

About this parameter

Maximum number of facet values to return for each facet during a regular search.

If you want to change the number of retrieved facet hits during a search for facet values, see maxFacetHits.

Usage notes:

  • For performance reasons, the API enforces a hard limit of 1000 on maxValuesPerFacet. Any value above that limit will be interpreted as 1000.

Examples

Set default number of facet values to retrieve

1
2
3
$index->setSettings([
  'maxValuesPerFacet' => 100
]);
1
2
3
$results = $index->search('query', [
  'maxValuesPerFacet' => 50
]);

Did you find this page helpful?