<<Previous: Using Parametric Search SQL | ↑Up: Using Parametric Search SQL | Next>>: Parameters Optional |
To aid this query/value separation, the Parametric Search SQL clause
refers to search parameters instead of literal values. These
parameters are specified as variables, and start with the prefix
$qp
. The Advanced Search form will automatically provide a
text box at search time, for each parameter referenced in the SQL
clause. The text box will be labeled after the name of the parameter
(without the $qp
prefix). Of course, a custom search form to
fill in the same variables can also be created and hosted on another
site, as with any profile.
For example, to search the field Price for values less than or equal to 50, using the infield: syntax the search user would have had to type this into the main text search box:
infield:Price<=50
for every search. But using SQL instead, the admin could set the SQL Query Clause setting just once to this:
Price <= $qpMaxPrice
and on the Advanced Search form, a box labeled "MaxPrice" will be provided for the search user, to fill out a form variable named qpMaxPrice. If we enter 50 in that box, the search will return results where the Price field is less than or equal to 50.
<<Previous: Using Parametric Search SQL | ↑Up: Using Parametric Search SQL | Next>>: Parameters Optional |