InnoDB Plugin
1.0
|
Go to the source code of this file.
Data Structures | |
struct | fts_ast_string_t |
struct | fts_ast_term_t |
struct | fts_ast_text_t |
struct | fts_ast_list_t |
struct | fts_ast_node_t |
struct | fts_ast_state_t |
Typedefs | |
typedef dberr_t(* | fts_ast_callback )(fts_ast_oper_t, fts_ast_node_t *, void *) |
Enumerations | |
enum | fts_ast_type_t { FTS_AST_OPER, FTS_AST_NUMB, FTS_AST_TERM, FTS_AST_TEXT, FTS_AST_LIST, FTS_AST_SUBEXP_LIST } |
enum | fts_ast_oper_t { FTS_NONE, FTS_IGNORE, FTS_EXIST, FTS_NEGATE, FTS_INCR_RATING, FTS_DECR_RATING, FTS_DISTANCE, FTS_IGNORE_SKIP, FTS_EXIST_SKIP } |
The FTS query parser (AST) abstract syntax tree routines
Created 2007/03/16/03 Sunny Bains
enum fts_ast_oper_t |
FTS_NONE |
No operator |
FTS_IGNORE |
Ignore rows that contain this word |
FTS_EXIST |
Include rows that contain this word |
FTS_NEGATE |
Include rows that contain this word but rank them lower |
FTS_INCR_RATING |
Increase the rank for this word |
FTS_DECR_RATING |
Decrease the rank for this word |
FTS_DISTANCE |
Proximity distance |
FTS_IGNORE_SKIP |
Transient node operator signifies that this is a FTS_IGNORE node, and ignored in the first pass of fts_ast_visit() |
FTS_EXIST_SKIP |
Transient node operator signifies that this ia a FTS_EXIST node, and ignored in the first pass of fts_ast_visit() |
enum fts_ast_type_t |
fts_ast_node_t* fts_ast_add_node | ( | fts_ast_node_t * | list, |
fts_ast_node_t * | node | ||
) |
in: (sub) expr to add
list | in: list node instance |
fts_ast_node_t* fts_ast_create_node_list | ( | void * | arg, |
fts_ast_node_t * | expr | ||
) |
in: ast expr
arg | in: ast state |
fts_ast_node_t* fts_ast_create_node_oper | ( | void * | arg, |
fts_ast_oper_t | oper | ||
) |
in: ast operator
arg | in: ast state |
fts_ast_node_t* fts_ast_create_node_subexp_list | ( | void * | arg, |
fts_ast_node_t * | expr | ||
) |
in: ast expr instance
arg | in: ast state instance |
fts_ast_node_t* fts_ast_create_node_term | ( | void * | arg, |
const fts_ast_string_t * | ptr | ||
) |
in: term string
arg | in: ast state |
fts_ast_node_t* fts_ast_create_node_text | ( | void * | arg, |
const fts_ast_string_t * | ptr | ||
) |
in: text string
arg | in: ast state |
UNIV_INTERN fts_ast_node_t* fts_ast_free_node | ( | fts_ast_node_t * | node | ) |
Free a fts_ast_node_t instance.
void fts_ast_node_print | ( | fts_ast_node_t * | node | ) |
in: ast node to print
void fts_ast_state_add_node | ( | fts_ast_state_t * | state, |
fts_ast_node_t * | node | ||
) |
in: node to add to state
state | in: ast state instance |
void fts_ast_state_free | ( | fts_ast_state_t * | state | ) |
in: state instance to free
UNIV_INTERN fts_ast_string_t* fts_ast_string_create | ( | const byte * | str, |
ulint | len | ||
) |
Create an ast string object, with NUL-terminator, so the string has one more byte than len
[in] | str | pointer to string |
[in] | len | length of the string |
UNIV_INTERN void fts_ast_string_free | ( | fts_ast_string_t * | ast_str | ) |
Free an ast string instance
[in,out] | ast_str | string to free |
UNIV_INTERN void fts_ast_string_print | ( | const fts_ast_string_t * | ast_str | ) |
Print the ast string
[in] | str | string to print |
UNIV_INTERN ulint fts_ast_string_to_ul | ( | const fts_ast_string_t * | ast_str, |
int | base | ||
) |
Translate ast string of type FTS_AST_NUMB to unsigned long by strtoul
[in] | str | string to translate |
[in] | base | the base |
void fts_ast_term_set_distance | ( | fts_ast_node_t * | node, |
ulint | distance | ||
) |
in: the text proximity distance
node | in/out: text node |
void fts_ast_term_set_wildcard | ( | fts_ast_node_t * | node | ) |
in: term to change
UNIV_INTERN dberr_t fts_ast_visit | ( | fts_ast_oper_t | oper, |
fts_ast_node_t * | node, | ||
fts_ast_callback | visitor, | ||
void * | arg, | ||
bool * | has_ignore | ||
) |
Traverse the AST - in-order traversal.
oper | in: FTS operator |
node | in: instance to traverse |
visitor | in: callback |
arg | in: callback arg |
has_ignore | out: whether we encounter and ignored processing an operator, currently we only ignore FTS_IGNORE operator |
UNIV_INTERN dberr_t fts_ast_visit_sub_exp | ( | fts_ast_node_t * | node, |
fts_ast_callback | visitor, | ||
void * | arg | ||
) |
Process (nested) sub-expression, create a new result set to store the sub-expression result by processing nodes under current sub-expression list. Merge the sub-expression result with that of parent expression list.
node | in: instance to traverse |
visitor | in: callback |
arg | in: callback arg |
UNIV_INTERN fts_lexer_t* fts_lexer_create | ( | ibool | boolean_mode, |
const byte * | query, | ||
ulint | query_len | ||
) |
boolean_mode | in: query type |
query | in: query string |
query_len | in: query string len |
UNIV_INTERN void fts_lexer_free | ( | fts_lexer_t * | fts_lexer | ) |
fts_lexer | in: lexer instance to free |
int fts_parse | ( | fts_ast_state_t * | state | ) |
in: ast state instance.