44#define FT_MAX_WORD_LEN_FOR_SORT 31
46#define FTPARSER_MEMROOT_ALLOC_SIZE 65536
60#define LWS_FOR_QUERY LWS_TF
61#define LWS_IN_USE LWS_LOG
62#define PRENORM_IN_USE PRENORM_AVG
63#define NORM_IN_USE NORM_PIVOT
64#define GWS_IN_USE GWS_PROB
67#define LWS_BINARY (count > 0)
68#define LWS_SQUARE (count * count)
69#define LWS_LOG (count ? (log((double)count) + 1) : 0)
71#define PRENORM_NONE (p->weight)
72#define PRENORM_MAX (p->weight / docstat.max)
73#define PRENORM_AUG (0.4 + 0.6 * p->weight / docstat.max)
74#define PRENORM_AVG (p->weight / docstat.sum * docstat.uniq)
75#define PRENORM_AVGLOG \
76 ((1 + log(p->weight)) / (1 + log(docstat.sum / docstat.uniq)))
79#define NORM_SUM (docstat.nsum)
80#define NORM_COS (sqrt(docstat.nsum2))
82#define PIVOT_VAL (0.0115)
83#define NORM_PIVOT (1 + PIVOT_VAL * docstat.uniq)
85#define GWS_NORM (1 / sqrt(sum2))
86#define GWS_GFIDF (sum / doc_cnt)
88#define GWS_IDF log(aio->info->state->records / doc_cnt)
89#define GWS_IDF1 log((double)aio->info->state->records / doc_cnt)
91 ((aio->info->state->records > doc_cnt) \
92 ? log(((double)(aio->info->state->records - doc_cnt)) / doc_cnt) \
94#define GWS_FREQ (1.0 / doc_cnt)
95#define GWS_SQUARED pow(log((double)aio->info->state->records / doc_cnt), 2)
96#define GWS_CUBIC pow(log((double)aio->info->state->records / doc_cnt), 3)
98 (1 - (suml / sum - log(sum)) / log(aio->info->state->records))
102#define FTB_YES (ft_boolean_syntax[0])
103#define FTB_EGAL (ft_boolean_syntax[1])
104#define FTB_NO (ft_boolean_syntax[2])
105#define FTB_INC (ft_boolean_syntax[3])
106#define FTB_DEC (ft_boolean_syntax[4])
107#define FTB_LBR (ft_boolean_syntax[5])
108#define FTB_RBR (ft_boolean_syntax[6])
109#define FTB_NEG (ft_boolean_syntax[7])
110#define FTB_TRUNC (ft_boolean_syntax[8])
111#define FTB_LQUOT (ft_boolean_syntax[10])
112#define FTB_RQUOT (ft_boolean_syntax[11])
FT_WORD * ft_linearize(TREE *, MEM_ROOT *)
Definition: ft_parser.cc:68
void ftparser_call_deinitializer(MI_INFO *info)
Definition: ft_parser.cc:364
void ft_parse_init(TREE *, const CHARSET_INFO *)
Definition: ft_parser.cc:245
FT_INFO * ft_init_nlq_search(MI_INFO *, uint, uchar *, uint, uint, uchar *)
Definition: ft_nlq_search.cc:220
int ft_nlq_read_next(FT_INFO *, char *)
Definition: ft_nlq_search.cc:309
const struct _ft_vft _ft_vft_boolean
Definition: ft_static.cc:62
const struct _ft_vft _ft_vft_nlq
Definition: ft_static.cc:59
int ft_parse(TREE *, uchar *, int, struct st_mysql_ftparser *parser, MYSQL_FTPARSER_PARAM *, MEM_ROOT *)
Definition: ft_parser.cc:291
float ft_nlq_find_relevance(FT_INFO *, uchar *, uint)
Definition: ft_nlq_search.cc:332
void ft_boolean_close_search(FT_INFO *)
Definition: ft_boolean_search.cc:942
bool true_word_char(int c, uint8_t ch)
Definition: ftdefs.h:40
void _mi_ft_segiterator_dummy_init(const uchar *, uint, FT_SEG_ITERATOR *)
Definition: ft_update.cc:50
void ft_nlq_close_search(FT_INFO *)
Definition: ft_nlq_search.cc:357
float ft_boolean_find_relevance(FT_INFO *, uchar *, uint)
Definition: ft_boolean_search.cc:885
uchar ft_get_word(const CHARSET_INFO *, uchar **, uchar *, FT_WORD *, MYSQL_FTPARSER_BOOLEAN_INFO *)
Definition: ft_parser.cc:121
void ft_nlq_reinit_search(FT_INFO *)
Definition: ft_nlq_search.cc:364
float ft_nlq_get_relevance(FT_INFO *)
Definition: ft_nlq_search.cc:359
my_off_t ft_nlq_get_docid(FT_INFO *)
MYSQL_FTPARSER_PARAM * ftparser_call_initializer(MI_INFO *info, uint keynr, uint paramnr)
Definition: ft_parser.cc:335
uint _mi_ft_parse(TREE *, MI_INFO *, uint, const uchar *, MYSQL_FTPARSER_PARAM *, MEM_ROOT *)
Definition: ft_update.cc:103
FT_WORD * _mi_ft_parserecord(MI_INFO *, uint, const uchar *, MEM_ROOT *)
Definition: ft_update.cc:122
struct _st_ft_seg_iterator FT_SEG_ITERATOR
FT_INFO * ft_init_boolean_search(MI_INFO *, uint, uchar *, uint, const CHARSET_INFO *)
Definition: ft_boolean_search.cc:517
int is_stopword(char *word, uint len)
Definition: ft_stopwords.cc:126
uint _mi_ft_segiterator(FT_SEG_ITERATOR *)
Definition: ft_update.cc:69
my_off_t ft_boolean_get_docid(FT_INFO *)
MYSQL_FTPARSER_PARAM * ftparser_alloc_param(MI_INFO *info)
Definition: ft_parser.cc:313
uchar ft_simple_get_word(const CHARSET_INFO *, uchar **, const uchar *, FT_WORD *, bool)
Definition: ft_parser.cc:211
void _mi_ft_segiterator_init(MI_INFO *, uint, const uchar *, FT_SEG_ITERATOR *)
Definition: ft_update.cc:41
int ft_boolean_read_next(FT_INFO *, char *)
Definition: ft_boolean_search.cc:744
uint _ft_make_key(MI_INFO *, uint, uchar *, FT_WORD *, my_off_t)
Definition: ft_update.cc:267
float ft_boolean_get_relevance(FT_INFO *)
Definition: ft_boolean_search.cc:951
void ft_boolean_reinit_search(FT_INFO *)
Definition: ft_boolean_search.cc:956
Some definitions for full-text indices.
A better implementation of the UNIX ctype(3) library.
static constexpr uint8_t MY_CHAR_L
Definition: m_ctype.h:542
static constexpr uint8_t MY_CHAR_NMR
Definition: m_ctype.h:543
static constexpr uint8_t MY_CHAR_U
Definition: m_ctype.h:541
ulonglong my_off_t
Definition: my_inttypes.h:72
unsigned char uchar
Definition: my_inttypes.h:52
Code for handling of priority queues.
Definition: m_ctype.h:423
Definition: ft_global.h:72
FTS query token.
Definition: fts0tokenize.h:62
uint len
word len
Definition: fts0tokenize.h:64
double weight
word weight, unused in innodb
Definition: fts0tokenize.h:65
uchar * pos
word start pointer
Definition: fts0tokenize.h:63
Definition: my_compare.h:60
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:83
Definition: myisamdef.h:253
Definition: plugin_ftparser.h:133
Definition: plugin_ftparser.h:195
Definition: ft_global.h:48
uint len
Definition: ftdefs.h:134
HA_KEYSEG * seg
Definition: ftdefs.h:135
const uchar * rec
Definition: ftdefs.h:136
uint num
Definition: ftdefs.h:134
const uchar * pos
Definition: ftdefs.h:136
Definition: plugin_ftparser.h:216