-
Notifications
You must be signed in to change notification settings - Fork 331
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
[Algolia] Invalid syntax for numeric condition:status=open #831
Comments
For those who want to search with filters, you can set filters by $orders = Order::search('Star Trek')->options([
'filters' => 'status:open OR status:paid',
])->get(); |
Could you share an exact code sample to reproduce this? |
// ......
use App\Models\User;
// ......
Artisan::command('scout-where-in', function () {
User::search('hi')
->whereIn('status', ['open', 'paid'])
->get();
}); And you will get
|
I'm so confused. This indeed can't ever work how it's implemented right now but has been around for like 8 years already. I can't believe we never caught this before... |
Hah, I originally documented this 😂 laravel/docs#7550 I guess I misunderstood how this worked in Algolia. However, we can't change the docs since meilisearch and other engines now work this way. I feel like we should update the AlgoliaEngine to use The refactored code to |
Thank you for reporting this issue! As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub. If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team. Thank you! |
@driesvints are we going to close this issue now? |
Going to close this one now but would like the PR from @Boorinio to be sent to 11.x instead. Thanks! |
Made a pr for 11.x |
Scout Version
10.9.0
Scout Driver
Algolia
Laravel Version
11.7
PHP Version
8.2.17
Database Driver & Version
No response
SDK Version
No response
Meilisearch CLI Version
No response
Description
Invalid syntax for numeric condition:status=open {"exception":"[object] (Algolia\AlgoliaSearch\Exceptions\BadRequestException(code: 400): Invalid syntax for numeric condition:status=open at /xxxx/vendor/algolia/algoliasearch-client-php/src/RetryStrategy/ApiWrapper.php:221)
The input filters are placed in
numericFilters
, but those are not numeric values, and should be place infilters
asstatus:open OR status:paid
Steps To Reproduce
whereIn
described in https://laravel.com/docs/11.x/scout#where-clausesThe text was updated successfully, but these errors were encountered: