MySQL 9.1.0
Source Code Documentation
ft_global.h
Go to the documentation of this file.
1#ifndef FT_GLOBAL_INCLUDED
2#define FT_GLOBAL_INCLUDED
3
4/* Copyright (c) 2000, 2024, Oracle and/or its affiliates.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License, version 2.0,
8 as published by the Free Software Foundation.
9
10 This program is designed to work with certain software (including
11 but not limited to OpenSSL) that is licensed under separate terms,
12 as designated in a particular file or component or in included license
13 documentation. The authors of MySQL hereby grant you an additional
14 permission to link the program and your derivative works with the
15 separately licensed software that they have either included with
16 the program or referenced in the documentation.
17
18 This program is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License, version 2.0, for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software
25 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
26
27/* Written by Sergei A. Golubchik, who has a shared copyright to this code */
28
29/**
30 @file include/ft_global.h
31 Some definitions for full-text indices.
32*/
33
34/* #include "myisam.h" */
35
36#include <sys/types.h>
37
38#include "my_base.h"
39#include "my_inttypes.h"
41
42#define HA_FT_MAXBYTELEN 336
43#define HA_FT_MAXCHARLEN (HA_FT_MAXBYTELEN / 4)
44
45#define DEFAULT_FTB_SYNTAX "+ -><()~*:\"\"&|"
46
47struct FT_INFO;
48struct _ft_vft {
49 int (*read_next)(FT_INFO *, char *);
50 float (*find_relevance)(FT_INFO *, uchar *, uint);
54};
55
56struct FT_INFO_EXT;
58 uint (*get_version)(); // Extended API version
62};
63
64/* Flags for extended FT API */
65#define FTS_ORDERED_RESULT (1LL << 1)
66#define FTS_DOCID_IN_RESULT (1LL << 2)
67
68#define FTS_DOC_ID_COL_NAME "FTS_DOC_ID"
69
70#define FTS_NGRAM_PARSER_NAME "ngram"
71
72struct FT_INFO {
73 struct _ft_vft *please; /* INTERCAL style :-) */
74};
75
76#ifndef FT_CORE
78 struct _ft_vft *please; /* INTERCAL style :-) */
80};
81#endif
82
83extern const char *ft_stopword_file;
84extern const char *ft_precompiled_stopwords[];
85
86extern ulong ft_min_word_len;
87extern ulong ft_max_word_len;
88extern ulong ft_query_expansion_limit;
89extern const char *ft_boolean_syntax;
91
92int ft_init_stopwords(void);
93void ft_free_stopwords(void);
94
95/**
96 Operation types, used in FT_HINTS.
97*/
98
100 FT_OP_UNDEFINED, /** Operation undefined, use of hints is impossible */
101 FT_OP_NO, /** No operation, single MATCH function */
102 FT_OP_GT, /** 'Greater than' operation */
103 FT_OP_GE /** 'Greater than or equal to' operation */
105
106#define FT_NL 0 /** Normal mode */
107#define FT_BOOL 1 /** Boolean mode */
108#define FT_SORTED 2 /** perform internal sorting by rank */
109#define FT_EXPAND 4 /** query expansion */
110#define FT_NO_RANKING 8 /** skip rank calculation */
111
112/**
113 Info about FULLTEXT index hints,
114 passed to the storage engine.
115*/
116
117struct ft_hints {
118 /** FULLTEXT flags, see FT_NL, etc */
119 uint flags;
120 /** Operation type */
122 /** Operation value */
123 double op_value;
124 /** LIMIT value, HA_POS_ERROR if not set */
126};
127
128FT_INFO *ft_init_search(uint, void *, uint, uchar *, uint, const CHARSET_INFO *,
129 uchar *);
131
132#endif /* FT_GLOBAL_INCLUDED */
FT_INFO * ft_init_search(uint, void *, uint, uchar *, uint, const CHARSET_INFO *, uchar *)
Definition: ft_static.cc:66
const char * ft_stopword_file
Definition: ft_static.cc:77
struct st_mysql_ftparser ft_default_parser
Definition: ft_static.cc:634
ft_operation
Operation types, used in FT_HINTS.
Definition: ft_global.h:99
@ FT_OP_UNDEFINED
Definition: ft_global.h:100
@ FT_OP_NO
Operation undefined, use of hints is impossible.
Definition: ft_global.h:101
@ FT_OP_GT
No operation, single MATCH function.
Definition: ft_global.h:102
@ FT_OP_GE
'Greater than' operation
Definition: ft_global.h:103
void ft_free_stopwords(void)
Definition: ft_stopwords.cc:133
const char * ft_precompiled_stopwords[]
Definition: ft_static.cc:78
ulong ft_max_word_len
Definition: ft_static.cc:35
ulong ft_min_word_len
Definition: ft_static.cc:34
const char * ft_boolean_syntax
Definition: ft_static.cc:37
int ft_init_stopwords(void)
Definition: ft_stopwords.cc:68
ulong ft_query_expansion_limit
Definition: ft_static.cc:36
bool ft_boolean_check_syntax_string(const uchar *)
Definition: ft_parser.cc:96
A better implementation of the UNIX ctype(3) library.
This file includes constants used by all storage engines.
my_off_t ha_rows
Definition: my_base.h:1141
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
unsigned char uchar
Definition: my_inttypes.h:52
Definition: m_ctype.h:421
Definition: ft_global.h:77
struct _ft_vft * please
Definition: ft_global.h:78
struct _ft_vft_ext * could_you
Definition: ft_global.h:79
Definition: ft_global.h:72
struct _ft_vft * please
Definition: ft_global.h:73
Definition: ft_global.h:57
ulonglong(* get_flags)()
Definition: ft_global.h:59
ulonglong(* count_matches)(FT_INFO_EXT *)
Definition: ft_global.h:61
uint(* get_version)()
Definition: ft_global.h:58
ulonglong(* get_docid)(FT_INFO_EXT *)
Definition: ft_global.h:60
Definition: ft_global.h:48
void(* reinit_search)(FT_INFO *)
Definition: ft_global.h:53
float(* find_relevance)(FT_INFO *, uchar *, uint)
Definition: ft_global.h:50
void(* close_search)(FT_INFO *)
Definition: ft_global.h:51
float(* get_relevance)(FT_INFO *)
Definition: ft_global.h:52
int(* read_next)(FT_INFO *, char *)
Definition: ft_global.h:49
Info about FULLTEXT index hints, passed to the storage engine.
Definition: ft_global.h:117
double op_value
Operation value.
Definition: ft_global.h:123
ha_rows limit
LIMIT value, HA_POS_ERROR if not set.
Definition: ft_global.h:125
enum ft_operation op_type
Operation type.
Definition: ft_global.h:121
uint flags
FULLTEXT flags, see FT_NL, etc.
Definition: ft_global.h:119
Definition: plugin_ftparser.h:216