🎉 Try the public beta of the new docs site at algolia.com/doc-beta! 🎉
API Reference / API Parameters / maxFacetHits
Type: integer
Engine default: 10
Parameter syntax
'maxFacetHits' => number_of_facet_hits

Can be used in these methods:

About this parameter

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

Usage notes

  • Doesn’t apply to regular search queries.
  • To determine the order in which facets are retrieved, see searchForFacetValues.
  • For performance reasons, the maximum allowed number of returned values is 100. Any value outside the range [1, 100] will be rejected.
  • To change the number of retrieved facet values for a regular search, see maxValuesPerFacet.

Examples

Set default number of facet values to return during a search for facet values

1
2
3
$index->setSettings([
  'maxFacetHits' => 10
]);
1
2
3
$facetValues = $index->searchForFacetValues("category", "phone", [
  'maxFacetHits' => 5
]);
Did you find this page helpful?