yfc / search-parser
Inno PHP Library
1.0.0
2018-09-10 15:55 UTC
Requires
- php: >=5.6
- avris/bag: ~3.0
- doctrine/dbal: ^2.6
- laravel/framework: ~5.3
Requires (Dev)
- phpunit/phpunit: ~5.7
This package is auto-updated.
Last update: 2025-03-01 00:23:17 UTC
README
Use JavaCC instead
Install
composer require yufangcheng/search-parser
Add the provider below to config/app.app
Inno\Lib\SearchParser\Providers\SearchParserServiceProvider::class
Then run the command
php artisan vendor:publish
Example
http://example.com/api/users?q=id:1
http://example.com/api/users?email~"*@gmail.com"
http://example.com/api/users?id:<1,2,3>
http://example.com/api/users?id:NOT <1,2,3>
http://example.com/api/users?id:[1 TO 100]
http://example.com/api/users?q=created_at:["-3 months" TO "now"] AND id:NOT [1 TO 100] OR (email:"*@vip.patsnap.com" OR id:888)&sort=id desc&fl=id,email&with=profile
To avoid the cut off of a too long URL by browser or server
Use the optianal header named search
to transmit the query string.
Field name pattern
Pattern |
---|
/^[a-zA-Z_][a-zA-Z0-9_]*$/i |
Function name pattern
Pattern |
---|
/^[a-z]\w*$/i |
Operators
Operators | Meaning | Supported Value Types | Example |
---|