MySQL 8.4.2
Source Code Documentation
|
#include <assert.h>
#include <stddef.h>
#include "my_inttypes.h"
#include "mysql/plugin.h"
#include "mysql/strings/m_ctype.h"
#include "storage/innobase/include/fts0tokenize.h"
Macros | |
#define | RETURN_IF_ERROR(ret) if (ret != 0) return ret; |
Functions | |
static int | ngram_parse (MYSQL_FTPARSER_PARAM *param, const char *doc, int len, MYSQL_FTPARSER_BOOLEAN_INFO *bool_info) |
Parse a document into ngram. More... | |
static int | ngram_get_token_size (const CHARSET_INFO *cs, const char *token, int len) |
Get token char size by charset. More... | |
static int | ngram_term_convert (MYSQL_FTPARSER_PARAM *param, const char *token, int len, MYSQL_FTPARSER_BOOLEAN_INFO *bool_info) |
Convert term into phrase and handle wildcard. More... | |
static int | ngram_parser_parse (MYSQL_FTPARSER_PARAM *param) |
Ngram parser parse document. More... | |
static | MYSQL_SYSVAR_INT (token_size, ngram_token_size, PLUGIN_VAR_READONLY, "InnoDB ngram full text plugin parser token size in characters", nullptr, nullptr, 2, 1, 10, 0) |
mysql_declare_plugin (ngram_parser) | |
Ngram plugin descriptor. More... | |
Variables | |
static int | ngram_token_size |
Ngram token size, by default bigram. More... | |
static struct st_mysql_ftparser | ngram_parser_descriptor |
Fulltext ngram parser. More... | |
static SYS_VAR * | ngram_system_variables [] = {MYSQL_SYSVAR(token_size), nullptr} |
Ngram plugin system variables. More... | |
mysql_declare_plugin_end | |
#define RETURN_IF_ERROR | ( | ret | ) | if (ret != 0) return ret; |
mysql_declare_plugin | ( | ngram_parser | ) |
Ngram plugin descriptor.
< type
< descriptor
< name
< author
< description
< init function (when loaded)
< check uninstall function
< deinit function (when unloaded)
< version
< status variables
< system variables
|
static |
|
static |
Get token char size by charset.
[in] | cs | charset |
[in] | token | token |
[in] | len | token length in bytes |
size | in number of chars |
|
static |
Parse a document into ngram.
[in] | param | plugin parser param |
[in] | doc | document to parse |
[in] | len | document length in bytes |
[in,out] | bool_info | boolean info |
0 | on success |
1 | on failure. |
|
static |
Ngram parser parse document.
[in] | param | plugin parser param |
0 | on success |
1 | on failure. |
|
static |
Convert term into phrase and handle wildcard.
[in] | param | plugin parser param |
[in] | token | token to parse |
[in] | len | token length in bytes |
[in,out] | bool_info | boolean info |
0 | on success |
1 | on failure. |
mysql_declare_plugin_end |
|
static |
Fulltext ngram parser.
|
static |
Ngram plugin system variables.
|
static |
Ngram token size, by default bigram.