API Reference / API Parameters / hitsPerPage
Type: integer
Engine default: 20
Parameter syntax
'hitsPerPage' => number_of_hits

Can be used in these methods:
search, setSettings, browseObjects, generateSecuredApiKey, addApiKey, updateApiKey

About this parameter# A

Set the number of hits per page for paginating the search results.

In most cases, page and hitsPerPage is the recommended method for pagination. For more information, see Paginate results.

Usage notes#

  • This is set at indexing time.
  • Setting can be overridden at query time.
  • 1000 is the maximum.

Examples# A

Set default number of hits per page#

1
2
3
$index->setSettings([
  'hitsPerPage' => 20
]);

Override default number of hits per page for the current search#

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