Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix using bundle configured nbResults for search #308

Merged
merged 2 commits into from
Dec 15, 2023

Conversation

norkunas
Copy link
Collaborator

Pull Request

Related issue

Fixes #306

What does this PR do?

  • Provides configured nbResults to engine search when it's not explicitly provided manually

PR checklist

Please check if your PR fulfills the following requirements:

  • Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
  • Have you read the contributing guidelines?
  • Have you made sure that the title is accurate and descriptive of the changes?

@@ -155,7 +155,7 @@ public function search(
): array {
$this->assertIsSearchable($className);

$ids = $this->engine->search($query, $this->searchableAs($className), $searchParams);
$ids = $this->engine->search($query, $this->searchableAs($className), $searchParams + ['limit' => $this->configuration['nbResults']]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we use an array_merge or something like that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need :) test proves that:)

Copy link
Member

@brunoocasali brunoocasali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM then!!!

@brunoocasali
Copy link
Member

bors merge

@brunoocasali brunoocasali added the bug Something isn't working label Dec 15, 2023
Copy link
Contributor

meili-bors bot commented Dec 15, 2023

Canceled.

@brunoocasali brunoocasali merged commit 846a7f5 into meilisearch:main Dec 15, 2023
7 of 8 checks passed
@norkunas norkunas deleted the fix-nbResults branch December 15, 2023 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nbResults is not set / ignored
2 participants