RangeSearch Command

Use the RangeSearch command in a Logic Template to search a numeric range index for records containing a value that lies within the same sub-range as a user-specified value, or to locate records containing a value that lies within a sub-range that is touched by a user specified range. To obtain exact results, the records returned by a search request should then be filtered by one of the Numeric Filters.

If fractional numbers must be indexed and retrieved, they should be stored as fixed point values with an implied number of decimal places. All values indexed by the numeric range index, as well as the numeric range itself, must have the same number of implied decimal places. Since the index does not currently store the number of implied decimal places, keeping track of the number of implied decimal places is left to the designers and programmers of the indexes and templates. When accessing a numeric range defined using values with implied decimal places, the search request should use values with the same number of implied decimal places.

To execute a Search Range Index request, use the RangeSearch command with five arguments:

RangeSearch( fc, idx, val, pas, wt );

RangeSearch Arguments

Argument

Description

fc

The function code defining how to merge results.( NONRESTRICTIVE, RESTRICTIVE )

idx

The range index to be searched.

val

The HTML variable containing the lower and upper limits of the numeric range, or the only value being searched for.

pas

The pass during which the search is to be executed.

wt

The weighting value to apply to this search. The weighting value may be passed directly or within an HTML variable.

Access the RangeSearch Dialog Box by selecting the Range Index->Range Index menu item under the Searching category of the Logic Template editor command menu.

Examples

Command

Description

RangeSearch( NONRESTRICTIVE, SICindex, SICcode, 1, 4);

Search numeric range index named "SICindex" during pass 1 with a weighting value of 4. Search for the value stored in HTML variable "SICcode" and OR results with other indexes.

SICcode = 72115;

RangeSearch( RESTRICTIVE, SICindex, SICcode, 3, 0);

Search numeric range index named "SICindex" during pass 3 without a weighting value. Search for the value 72115 and AND results with other indexes.

IF ( SICcode )

RangeSearch( NONRESTRICTIVE, SICindex, SICcode, 1, Weight);

ENDIF

IF the HTML variable contains something other than zero, search the numeric range index named "SICindex" during pass 1 for the value stored in HTML variable "SICcode" and OR the results to other indexes using a weighting value stored in HTML variable "Weight"

IF ( Price )

RangeSearch( NONRESTRICTIVE, PriceIndex, Price, 1, Weight);

ENDIF

If a price range has been returned in the HTML variable "Price", search the numeric range index named "PriceIndex" during pass 1 for a value within the range stored in HTML variable "Price". OR results with other indexes using a weighting value stored in the HTML variable "Weight".

Price = [5000 :: 9999 ];

RangeSearch( RESTRICTIVE, PriceIndex, Price, 2, 4);

Search numeric range index named "PriceIndex" during pass 2 with a weighting value of 4. Search for a value between 5000 and 9999 and OR results with other indexes.