4.6. Range Searching
Range searching allows qualification of search returns with a field that must be within a certain numeric or alphanumeric range. To use it, set the mv_range_look variable to the products database field, or a column/field number for another file. Then, set the corresponding mv_range_min and mv_range_max variables with a selectable field.
<INPUT TYPE="hidden" NAME="mv_range_look" VALUE="price"> Search on Price Min <SELECT NAME="mv_range_min"> <OPTION value=0 SELECTED> Free <OPTION value=1000000> $1,000,000 <OPTION value=10000000> $10,000,000 <OPTION value=20000000> $20,000,000 <OPTION value=40000000> $40,000,000 </SELECT><BR> Max <SELECT NAME="mv_range_max"> <OPTION value=0 SELECTED> no object <OPTION value=1000000> $1,000,000 <OPTION value=10000000> $10,000,000 <OPTION value=20000000> $20,000,000 <OPTION value=40000000> $40,000,000 </SELECT>
The value of 0 for mv_range_max is equivalent to infinity if doing a numeric search. This makes it impossible to search for a ceiling of 0 with a negative mv_range_min.
The fields are stackable, so more than one range to check can be set. The order is significant, in the sense that the array of field names and minimum/maximum values must be kept in order to achieve correspondence.
The optional mv_range_alpha specification allows alphanumeric range matching for the corresponding field. If it is set, and the fields are stacked, they must all be set. The mv_case field does apply if it is set. Otherwise, the comparison is without regard to case.
If ONLY a range search is required, all lines with mv_return_all=yes must be selected in order to make the search operate. Range-only searches will be quite slow for large databases since every line must be scanned. It should be quite usable for catalogs of less than 10,000 items in size on a fast machine. Using it in combination with another search technique (in the same query) will yield faster search returns.