Skip to content

Surface per-search multi_search errors - #38

Open
edalzell wants to merge 1 commit into
statamic-rad-pack:mainfrom
edalzell:fix/multi-search-errors
Open

edalzell wants to merge 1 commit into
statamic-rad-pack:mainfrom
edalzell:fix/multi-search-errors

Conversation

@edalzell

Copy link
Copy Markdown
Contributor

Typesense can return HTTP 200 from /multi_search while an individual search contains code and error instead of hits. The driver then hid the useful API response behind Undefined array key \"hits\".

This detects the per-search error and throws TypesenseClientError with the original message and status.

Closes #37

Tests

  • vendor/bin/phpunit tests/Unit/SearchUsingApiTest.php tests/Unit/GetOrCreateIndexTest.php
  • vendor/bin/pint --test src/Typesense/Index.php tests/Unit/SearchUsingApiTest.php

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.

Surface per-search multi_search errors

1 participant