laravel / scout

Laravel Scout provides a driver based solution to searching your Eloquent models.
https://laravel.com/docs/scout
MIT License
1.54k stars 327 forks source link

Methods don't work as well as they do in the manual. #844

Closed Kim-Munbeom closed 2 months ago

Kim-Munbeom commented 2 months ago

Scout Version

10.9.0

Scout Driver

Algolia

Laravel Version

10.48.11

PHP Version

8.3.8

Database Driver & Version

No response

SDK Version

3.1.0

Meilisearch CLI Version

No response

Description

OMG!!! hello. everyone! What a bad time to say goodbye. I am so annoyed. I'm using algolia with laravel scout, and I'm looking at the builder.php file and getting annoyed because I can never get it to work, even after following the manual, so I'm raising this issue. Why can I only search for numbers but not characters when using the "where method"? The same problem occurs when using the "whereIn method". Looking at the "Algolia package", why is there an "operator" for using the "where method", but not in the laravel-scout package?

Steps To Reproduce

Model::search($keyword)
  ->within($document)
  ->where('answer', 1) // Works
  ->where('answer', '>', 1) // Does not work
  ->where('job', 'developer') // Does not work
  ->paginate($limit);
driesvints commented 2 months ago

Your third example will work in the next major version: https://github.com/laravel/scout/pull/839

The second example simple isn't available with Scout at this time. Right now we don't have plans for it, sorry.