Index  Up  <<  >>  


Dictionary indexing with INDEX

MiniVend will automatically build index files for a fast binary search of an individual field. This type of search is useful for looking up the author of a book based on the beginning of their last name, a book title based on its beginning, or other analagous situations.

Such a search requires a dictionary ordered index with the field to be searched contained in the first field and the database key (product code) in the second field. If you specify the INDEX field modifier MiniVend will build the index upon database import:

   Database  products  products.asc   TAB
   Database  products  INDEX          title

If the title field is the fourth column in the products database table, a file products.asc.4 will be built, containing two tab-separated fields something like:

    American Gothic   19-202
    Mona Lisa         00-0011
    Sunflowers        00-342
    The Starry Night  00-343

The fast binary search is described in greater detail below -- see THE SEARCH ENGINE.


Index  Up  <<  >>