FATS - Fast Access Tree System
Table of Contents
List of Commands
"MS" Search in Matchcode

"MS" Search in Matchcode


Command string:

CMND$ = "MS\{FileNo}\{Flags}\{Total}\{SearchGrp1}[\{SearchGrp2}...]"

FileNoFile number
FlagsThe following flags are supported:
S#The result set is by means of the sort key # (1-4) sorted alphanumerically. Sorting occurs within the sorting groups generated by FATS for the qualitative weight of the hits. Please take a further explanation of the sort keys from the description of the  "MC" command.
GF#This flag initiates FATS to ignore hits of the sorting groups < #, to i.e. only incorporate the hits in the result set that do not fall into one of the sorting groups less than the specified one.
TotalMaximum number of hits in the result set:
0All hits are set into the result set. This regulation works very fast, however, no sorting occurs by means of hit quality.
!= 0It is attempted to put the specified number of hits into the result set. These hits are subjected to a sorting concerning their quality and then put into one of 7 sorting groups. With the additional utilization of a sort key ("#S"), only 500 hits are possible.
SearchGrp#The in search group # searched terms.

Purpose:

Query the matchcode index, and setup an result set.

Description:

This command searches the matchcode index and fills the result set with the record- resp. ID-numbers of data records which include the searched terms. If FATS finds the requested terms, it returns the record- resp. ID-number of the first hit in the RECNO variable and a errorcode of 0. The result set can then be read out with the browser commands ("MA", "ME", "MN", "MP" ...). If no hits exist in the result set, the errorcode variable has the value #16.

If the specified query consists of more than one search group the results from each search group are joined with the AND-operator, i.e. a data record is selected only if it shows all asked terms within the respective search groups. The search terms are separated from each other by blanks and the search groups (SearchGrp#) through the FATS separator (usually, a backslash).

The "Total"-flag allows sorting the result set by means of hit quality. These hits are subjected to a sorting concerning their quality and then put into one of 7 sorting groups. The sorting groups 1 to 3 are supported only if the flag  "L" was specified in the Create Matchcode File (MC) command.
The following sequence within the result set results during use of the sorting groups:

Group 1:The searched term stands as a whole word at the beginning of a data column. (e.g. "Beton für den Heimwerker")
Group 2:Like group 1, however, the term is disturbed by one or several blanks or separators. (e.g. "B e t o n")
Group 3:Like group 2, however, the searched term only occurs at the beginning of a word. (e.g. "Betonerzeugnisse").
Group 4:Like group 1, however, the term is not at the beginning of the data column (e.g. "Frischer Beton vom Fachbetrieb").
Group 5:Like group 2, however not at the start of column.
Group 6:Like group 3, however, the term is not at the beginning of the data column (e.g. "Neue Betonmischer abzugeben").
Group 7:All remaining hits (e.g. "Spannbeton", "Spannbetonwerk" or "do not bet on me").

This command is only supported by the extended version of FATS.

Parameters returned:

ERRORCODE:Errorcode or 0 (no error)
RECNO:Record number
FATSKEY:If a primary key was generated during the creation of the matchcode index file with the "K#:#" flag, it is made available via this variable to the application program.

Example:

CMND$ = "MS\1\\0\"+SEARCHGRP1$+"\"+SEARCHGRP2

or consider only the first search group, no hit limitation:

CMND$ = "MS\1\\0\"+SEARCHGRP1$

or search only in the second search group (a maximum of 150 hits):

CMND$ = "MS\1\\150\"+"\"+SEARCHGRP2$

 BASIC Example
 Pascal Example
 C Example

See also:

 "MA" Get Next Result After; page 4-50
 "ME" Get Previous Result Before; page 4-63
 "MF" Get First Result; page 4-65
 "ML" Get Last Result; page 4-69


 

© 2008  GCS Software, Udo Gertz