meilisearch / meilisearch-symfony

Seamless integration of Meilisearch into your Symfony project.
https://www.meilisearch.com
MIT License
122 stars 28 forks source link

`nbResults` is not set / ignored #306

Closed wucherpfennig closed 9 months ago

wucherpfennig commented 10 months ago

Description nbResults is ignored

Expected behavior Set default max number of results per search

Current behavior Defaults to always 20

Screenshots or Logs meilisearch.yaml :

meilisearch:
  url: http://meili:7700
  nbResults: 5

the issue can be resolved by setting manually a limit like

            $result = $this->meiliSearchService->search(
                objectManager: $this->entityManager,
                className: PriceList::class,
                query: $searchTerm,
                searchParams: [
                    'limit' => 5,
                    'filter' => sprintf('tenant.name = "%s"', $tenant->getName())
                ]
            );