Quick Search
Quick Search
is another table data search method other than filter
, which is used to quickly filter the data you want. The way to open it is as follows:
A search box will appear in the header
Set different search methods by passing different parameters to the quickSearch
method. There are several ways to use them.
Like Search
The first way, by setting the field name for a simple like
query
Or do a 'like` query on multiple fields:
Custom Search
The second way gives you more control over your search criteria.
The parameter $query
of the closure is filled in for the content in the search box, and the query in the closure is submitted after the submission.
Quick syntax search
The third way is to refer to the search syntax of Github
for quick search. The calling method is as follows:
Fill in the contents of the search box according to the following syntax, after the submission will be the corresponding query:
Compare Query
title:foo
,title:!foo
rate:>10
, rate:<10
, rate:>=10
, rate:<=10
In, NotIn query
status:(1,2,3,4)
, status:!(1,2,3,4)
Between Query
score:[1,10]
Time Date Function Query
created_at:date,2019-06-08
created_at:time, 09:57:45
created_at:day,08
created_at:month,06
created_at:year,2019
Like Query
content:%Laudantium%
Regular query
username:/song/
Please use MYSQL regular syntax here
Multi-conditional combination search
You can implement AND query of multiple fields by separating multiple search statements with commas, such as username:%song% status:(1,2,3)
, after running, the following search will be run.
If a condition is an OR
query, just add a |
symbol before the statement unit: username:%song% |status:(1,2,3)
If the filled query text contains spaces, you need to put it in double quotes: updated_at:"2019-06-08 09:57:45"
Label as the name of the query field
If it is not convenient to get the field name, you can directly use the label
name as the query field.
Then you can fill in the user status: (1, 2, 3)
to execute the following query
Last updated