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

Allow filtering by comparison operators #835

Closed drasko95 closed 3 months ago

drasko95 commented 3 months ago

Allows the use of different comparison operators (>, <, <=, >=, etc) in supported search engines.

A new method whereComparison and its underlying property have been created to avoid breaking changes. It can be used as:

User::search('john')->whereComparison('age', '>=', 18)

Related issues: https://github.com/laravel/scout/issues/799 https://github.com/laravel/scout/issues/776 https://github.com/laravel/scout/issues/744 https://github.com/laravel/scout/issues/529

taylorotwell commented 3 months ago

Thanks for your pull request to Laravel!

Unfortunately, I'm going to delay merging this code for now. To preserve our ability to adequately maintain the framework, we need to be very careful regarding the amount of code we include.

If possible, please consider releasing your code as a package so that the community can still take advantage of your contributions!

If you feel absolutely certain that this code corrects a bug in the framework, please "@" mention me in a follow-up comment with further explanation so that GitHub will send me a notification of your response.