You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While searching with a boolean filter (e.g. Model::search($query)->where('myFilter', true)->get), TypesenseEngine.php will transform the true value into 1 before passing it into the typesense-php SDK to be sent to the Typsense server. This results in a Typesense\Exceptions\RequestMalformed exception with a message of "Value of filter field myFilter must be true or false."
I believe I have narrowed the issue down to the method TypesenseEngine::filters(), specifically the calls to Collection::map() here:
Looking at the data within the Builder instance passed into this function, I see boolean values for the filter parameters. However when I look at the $value parameter passed into parseWhereFilter() I see a 1 where the Builder contained true.
Steps To Reproduce
Install and configure Laravel Scout in a Laravel Project
Configure a searchable model with a boolean field
Sync any models necessary
Attempt to perform a search on that model, filtering the boolean field to true
Observe a RequestMalformed exception.
The text was updated successfully, but these errors were encountered:
Thinking on this, I wonder if it might be undesired functionality for the Collection/Array map() function to do this in general, or if it's expected and understood.
If the latter, I would be happy to write a PR to fix this issue for scout.
Scout Version
10.11.3
Scout Driver
Typesense
Laravel Version
10.48.22
PHP Version
8.2.23
Database Driver & Version
No response
SDK Version
No response
Meilisearch CLI Version
No response
Description
While searching with a boolean filter (e.g.
Model::search($query)->where('myFilter', true)->get
), TypesenseEngine.php will transform thetrue
value into1
before passing it into thetypesense-php
SDK to be sent to the Typsense server. This results in aTypesense\Exceptions\RequestMalformed
exception with a message of "Value of filter fieldmyFilter
must betrue
orfalse
."I believe I have narrowed the issue down to the method
TypesenseEngine::filters()
, specifically the calls toCollection::map()
here:Looking at the data within the
Builder
instance passed into this function, I see boolean values for the filter parameters. However when I look at the$value
parameter passed intoparseWhereFilter()
I see a1
where the Builder containedtrue
.Steps To Reproduce
true
RequestMalformed
exception.The text was updated successfully, but these errors were encountered: