MySQL 8.0.39
Source Code Documentation
ft_boolean_search.cc File Reference
#include <fcntl.h>
#include <sys/types.h>
#include <algorithm>
#include "my_compiler.h"
#include "my_dbug.h"
#include "my_inttypes.h"
#include "my_macros.h"
#include "storage/myisam/ftdefs.h"
#include "storage/myisam/myisamdef.h"
#include "template_utils.h"

Classes

struct  FTB_EXPR
 
struct  FTB_WORD
 
struct  FTB
 
struct  MY_FTB_PARAM
 
struct  MY_FTB_PHRASE_PARAM
 
struct  MY_FTB_FIND_PARAM
 

Macros

#define FT_CORE
 
#define FTB_FLAG_TRUNC   1
 
#define FTB_FLAG_YES   2
 
#define FTB_FLAG_NO   4
 
#define FTB_FLAG_WONLY   8
 
#define CMP_NUM(a, b)   (((a) < (b)) ? -1 : ((a) == (b)) ? 0 : 1)
 

Functions

static int FTB_WORD_cmp (void *v_v, uchar *u_a, uchar *u_b)
 
static int ftb_query_add_word (MYSQL_FTPARSER_PARAM *param, char *word, int word_len, MYSQL_FTPARSER_BOOLEAN_INFO *info)
 
static int ftb_parse_query_internal (MYSQL_FTPARSER_PARAM *param, char *query, int len)
 
static int _ftb_parse_query (FTB *ftb, uchar *query, uint len, struct st_mysql_ftparser *parser)
 
static int _ftb_no_dupes_cmp (const void *, const void *a, const void *b)
 
static int _ft2_search_no_lock (FTB *ftb, FTB_WORD *ftbw, bool init_search)
 
static int _ft2_search (FTB *ftb, FTB_WORD *ftbw, bool init_search)
 
static void _ftb_init_index_search (FT_INFO *ftb_base)
 
FT_INFOft_init_boolean_search (MI_INFO *info, uint keynr, uchar *query, uint query_len, const CHARSET_INFO *cs)
 
static int ftb_phrase_add_word (MYSQL_FTPARSER_PARAM *param, char *word, int word_len, MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info)
 
static int ftb_check_phrase_internal (MYSQL_FTPARSER_PARAM *param, char *document, int len)
 
static int _ftb_check_phrase (FTB *ftb, const uchar *document, uint len, FTB_EXPR *ftbe, struct st_mysql_ftparser *parser)
 
static int _ftb_climb_the_tree (FTB *ftb, FTB_WORD *ftbw, FT_SEG_ITERATOR *ftsi_orig)
 
int ft_boolean_read_next (FT_INFO *ftb_base, char *record)
 
static int ftb_find_relevance_add_word (MYSQL_FTPARSER_PARAM *param, char *word, int len, MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info)
 
static int ftb_find_relevance_parse (MYSQL_FTPARSER_PARAM *param, char *doc, int len)
 
float ft_boolean_find_relevance (FT_INFO *ftb_base, uchar *record, uint length)
 
void ft_boolean_close_search (FT_INFO *ftb_base)
 
float ft_boolean_get_relevance (FT_INFO *ftb_base)
 
void ft_boolean_reinit_search (FT_INFO *ftb)
 

Variables

static double _wghts [11]
 
static double * wghts = _wghts + 5
 
static double _nwghts [11]
 
static double * nwghts = _nwghts + 5
 

Macro Definition Documentation

◆ CMP_NUM

#define CMP_NUM (   a,
 
)    (((a) < (b)) ? -1 : ((a) == (b)) ? 0 : 1)

◆ FT_CORE

#define FT_CORE

◆ FTB_FLAG_NO

#define FTB_FLAG_NO   4

◆ FTB_FLAG_TRUNC

#define FTB_FLAG_TRUNC   1

◆ FTB_FLAG_WONLY

#define FTB_FLAG_WONLY   8

◆ FTB_FLAG_YES

#define FTB_FLAG_YES   2

Function Documentation

◆ _ft2_search()

static int _ft2_search ( FTB ftb,
FTB_WORD ftbw,
bool  init_search 
)
static

◆ _ft2_search_no_lock()

static int _ft2_search_no_lock ( FTB ftb,
FTB_WORD ftbw,
bool  init_search 
)
static

◆ _ftb_check_phrase()

static int _ftb_check_phrase ( FTB ftb,
const uchar document,
uint  len,
FTB_EXPR ftbe,
struct st_mysql_ftparser parser 
)
static

◆ _ftb_climb_the_tree()

static int _ftb_climb_the_tree ( FTB ftb,
FTB_WORD ftbw,
FT_SEG_ITERATOR ftsi_orig 
)
static

◆ _ftb_init_index_search()

static void _ftb_init_index_search ( FT_INFO ftb_base)
static

◆ _ftb_no_dupes_cmp()

static int _ftb_no_dupes_cmp ( const void *  ,
const void *  a,
const void *  b 
)
static

◆ _ftb_parse_query()

static int _ftb_parse_query ( FTB ftb,
uchar query,
uint  len,
struct st_mysql_ftparser parser 
)
static

◆ ft_boolean_close_search()

void ft_boolean_close_search ( FT_INFO ftb_base)

◆ ft_boolean_find_relevance()

float ft_boolean_find_relevance ( FT_INFO ftb_base,
uchar record,
uint  length 
)

◆ ft_boolean_get_relevance()

float ft_boolean_get_relevance ( FT_INFO ftb_base)

◆ ft_boolean_read_next()

int ft_boolean_read_next ( FT_INFO ftb_base,
char *  record 
)

◆ ft_boolean_reinit_search()

void ft_boolean_reinit_search ( FT_INFO ftb)

◆ ft_init_boolean_search()

FT_INFO * ft_init_boolean_search ( MI_INFO info,
uint  keynr,
uchar query,
uint  query_len,
const CHARSET_INFO cs 
)

◆ ftb_check_phrase_internal()

static int ftb_check_phrase_internal ( MYSQL_FTPARSER_PARAM param,
char *  document,
int  len 
)
static

◆ ftb_find_relevance_add_word()

static int ftb_find_relevance_add_word ( MYSQL_FTPARSER_PARAM param,
char *  word,
int  len,
MYSQL_FTPARSER_BOOLEAN_INFO boolean_info 
)
static

◆ ftb_find_relevance_parse()

static int ftb_find_relevance_parse ( MYSQL_FTPARSER_PARAM param,
char *  doc,
int  len 
)
static

◆ ftb_parse_query_internal()

static int ftb_parse_query_internal ( MYSQL_FTPARSER_PARAM param,
char *  query,
int  len 
)
static

◆ ftb_phrase_add_word()

static int ftb_phrase_add_word ( MYSQL_FTPARSER_PARAM param,
char *  word,
int  word_len,
MYSQL_FTPARSER_BOOLEAN_INFO boolean_info 
)
static

◆ ftb_query_add_word()

static int ftb_query_add_word ( MYSQL_FTPARSER_PARAM param,
char *  word,
int  word_len,
MYSQL_FTPARSER_BOOLEAN_INFO info 
)
static

◆ FTB_WORD_cmp()

static int FTB_WORD_cmp ( void *  v_v,
uchar u_a,
uchar u_b 
)
static

Variable Documentation

◆ _nwghts

double _nwghts[11]
static
Initial value:
= {
-0.065843621399177, -0.098765432098766, -0.148148148148148,
-0.222222222222222, -0.333333333333334, -0.500000000000000,
-0.750000000000000, -1.125000000000000, -1.687500000000000,
-2.531250000000000, -3.796875000000000}

◆ _wghts

double _wghts[11]
static
Initial value:
= {
0.131687242798354, 0.197530864197531, 0.296296296296296, 0.444444444444444,
0.666666666666667, 1.000000000000000, 1.500000000000000, 2.250000000000000,
3.375000000000000, 5.062500000000000, 7.593750000000000}

◆ nwghts

double* nwghts = _nwghts + 5
static

◆ wghts

double* wghts = _wghts + 5
static