Databases Reference
In-Depth Information
int (*init)(MYSQL_FTPARSER_PARAM *param);
int (*deinit)(MYSQL_FTPARSER_PARAM *param);
};
Besides the obligatory API version number it contains the callback functions that
MySQL will use to perform the parsing job. The parser init() function is called
once per statement before any parsing is done. The deinit() function is called at
the end of the statement if the init() function was called. The parse() function is
called somewhere between init() and deinit() calls, as many times as necessary,
and does the actual parsing.
Do not confuse parser init() and deinit() functions from
the st_mysql_ftparser structure with the plugin init()
and deinit() functions from the st_mysql_plugin structure.
These, as we remember, can be specified for a plugin of any type,
and they are called when a plugin is loaded and unloaded.
All of these parser functions take a structure called MYSQL_FTPARSER_PARAM as an
argument. This structure contains a pointer to the text that needs to be parsed and
pointers to server functions that parse the text and consume parsed words. The
complete definition of this structure is as follows:
typedef struct st_mysql_ftparser_param
{
int (*mysql_parse)(struct st_mysql_ftparser_param *,
char *doc, int doc_len);
int (*mysql_add_word)(struct st_mysql_ftparser_param *,
char *word, int word_len,
MYSQL_FTPARSER_BOOLEAN_INFO *);
void *ftparser_state;
void *mysql_ftparam;
struct charset_info_st *cs;
char *doc;
int length;
int flags;
enum enum_ftparser_mode mode;
} MYSQL_FTPARSER_PARAM;
The following table describes each of the elements inside this structure:
Element
Description
mysql_parse()
MySQL's built-in full-text parser. The server would have used it to
split a text into words if there were no plugin specified.
Search WWH ::




Custom Search