MiniVend implements a search engine which will search the product database
(or any other file) for items based on customer input. It uses either forms
or link-based searches that are called with the special page name
scan
. The search engine uses many special MiniVend tags and variables.
If the search is implemented in a link or a form, it will always display
formatted results on the results page, a MiniVend page that uses some combination of the [search-region]
, [search-list]
,
[more-list]
, [more]
, and other MiniVend tags to format and display the results. The search
results are usually a series of product codes/SKUs or other database keys,
which are then iterated over similar to the
[item-list]
.
Examples of search forms and result pages are included in the supplied demos.
Two search engine interfaces are provided, and five types of searching are
available. The default is a text-based search of the
products.asc
file.
A binary search of a dictionary-ordered file can be
specified. An optional Glimpse search is enabled by placing the command
specification for Glimpse in the directive Glimpse. There is a range-based search, used in combination with one of the above. And finally, there is an
SQL search which translates the MiniVend search interface to
SQL queries.
The default, a text based search, sequentially scans the lines in the target file. By default it returns the first field (delineated by the standard Delimiter), for every line matching the search specification. This corresponds to the product code, which is then used to key specific accesses to the database.
The text-based search is capable of sophisticated field-specific searches with fully-independent case-sensitivity, substring, and negated matching. (There is not yet a full search language except for SQL queries, so AND/OR matching is not supported across multiple fields. Stay tuned for this in MiniVend 3.1 or later.)