Glimpse

### Index Up << >>

## Glimpse

To use the Glimpse search, you must build the Glimpse index based on files in your ProductDir, or wherever the files to be searched will be located. If you installed MiniVend in the default `/usr/local/lib/minivend`, the command line to build the index for the products file would be:

        chdir products
        glimpseindex -b -H . products.txt

There are several ways to improve search speed for large catalogs.

One method that works well for large `products.txt` files is to split the `products.txt` file into small index files (in the example, 100 lines) with the `split(1)` UNIX/POSIX command, then index it with glimpse:

        split -100 products.txt index.txt.
        glimpseindex -H /usr/local/lib/minivend/products index.txt.*

This will dramatically increase search speeds for large catalogs, at least if the search term is relatively unique. If it is a common string, as you might have in a category search, you will be better off to use the text-based search.

If you are intending to search for numbers, add the `-n` option to the Glimpse command line.

(A large catalog is one of more than several thousand items -- smaller ones have acceptable speed in any of the search modes.)

If the Glimpse executable is not found at MiniVend startup, the Glimpse search will be disabled and the regular text-based search used instead.

There are several things you have to watch for while using glimpse, and a liberal dose of the Glimpse documentation is suggested. In particular, the spelling error capability will not work in combination with the field-specific search -- Glimpse selects the line, but MiniVend's text-based search routines disqualify it when checking to see if the search string is within one of the specified fields.

To use field-specific searching on Glimpse, you need to tell it what the field names are. If your search is on your products database (file), nothing is needed, for the default is to use the field names from the products database. If it is some other field layout, specify the file to get the field names from with `mv_field_file` (ff).

### Index Up << >>