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: merge Algolia4 options into query parameters #890

Closed
wants to merge 1 commit into from

Conversation

MingJen
Copy link
Contributor

@MingJen MingJen commented Dec 3, 2024

Background

In Algolia v3, search options were included directly in the query parameters. However, in Algolia v4, options passed as the third parameter to the searchSingleIndex method are interpreted as request options, affecting headers and query strings, which can lead to unintended behavior—specifically, options like hitsPerPage become ineffective.

Changes:

  • Merge $options into $queryParams
    Used array_merge to combine $options with $queryParams, ensuring all search options are included in the query parameters as expected by Algolia v4.
  • Remove Third Parameter
    Stopped passing $options as the third argument to searchSingleIndex to prevent them from being misinterpreted as request options.

Impact:

  • Correct Application of Search Options
    Ensures that options like hitsPerPage now function correctly.
  • Consistency with Algolia v4 Behavior
    Aligns our implementation with Algolia v4's expected input handling.

Copy link

github-actions bot commented Dec 3, 2024

Thanks for submitting a PR!

In order to review and merge PRs most efficiently, we require that all PRs grant maintainer edit access before we review them. For information on how to do this, see the relevant GitHub documentation. Additionally, GitHub doesn't allow maintainer permissions from organization accounts. Please resubmit this PR from a personal GitHub account with maintainer permissions enabled.

@github-actions github-actions bot closed this Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant