Logo

Parametric Search Appliance

This is custom script. Do not install updates.

 

Thunderstone Search Appliance Manual

<<Previous: Embedded Parameters ↑Up: Using Parametric Search SQL Next>>: Group By

Parameters Optional

The SQL Query Clause has the additional feature that parameters are optional: if a given $qp... parameter is not provided a value at search time, or is given an empty value, then that part of the SQL clause is automatically dropped. This allows the SQL Query Clause to be made as complex as needed for the most-specific possible query, yet automatically "fall back" to a simpler version (or none at all) if certain parts are not needed.

For example, a profile with the fields Color, Price and Quantity might have its SQL Query Clause set to:

Color = $qpDesiredColor and Price <= $qpMaxPrice and
  (Quantity >= $qpMin and Quantity <= $qpMax)

This will search all three fields, if all of the $qp... parameters are provided. However, if say only qpMaxPrice and qpMin were provided non-empty values at search time, the equivalent search clause actually used would effectively be just:

Price <= $qpMaxPrice and (Quantity >= $qpMin)

This feature allows tremendous flexibility in users' searches. One search form can now handle a full spectrum of queries - from complex drill-down queries with many parameters to simple text searches - without reconfiguration by the admin or "knob-turning" by the search user. The profile will simply search for the fields filled in, no more no less.


Copyright © Thunderstone Software     Last updated: Jul 28 2017

<<Previous: Embedded Parameters ↑Up: Using Parametric Search SQL Next>>: Group By
Page generated in 0.13 seconds.
2024-09-27 23:22:44 EDT