MySQL 8.3.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, 2023, 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 also distributed 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 included with MySQL.
16
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License, version 2.0, for more details.
21
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software
24 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
25
26/* Written by Sergei A. Golubchik, who has a shared copyright to this code */
27
28/**
29 @file include/ft_global.h
30 Some definitions for full-text indices.
31*/
32
33/* #include "myisam.h" */
34
35#include <sys/types.h>
36
37#include "my_base.h"
38#include "my_inttypes.h"
40
41#define HA_FT_MAXBYTELEN 336
42#define HA_FT_MAXCHARLEN (HA_FT_MAXBYTELEN / 4)
43
44#define DEFAULT_FTB_SYNTAX "+ -><()~*:\"\"&|"
45
46struct FT_INFO;
47struct _ft_vft {
48 int (*read_next)(FT_INFO *, char *);
49 float (*find_relevance)(FT_INFO *, uchar *, uint);
53};
54
55struct FT_INFO_EXT;
57 uint (*get_version)(); // Extended API version
61};
62
63/* Flags for extended FT API */
64#define FTS_ORDERED_RESULT (1LL << 1)
65#define FTS_DOCID_IN_RESULT (1LL << 2)
66
67#define FTS_DOC_ID_COL_NAME "FTS_DOC_ID"
68
69#define FTS_NGRAM_PARSER_NAME "ngram"
70
71struct FT_INFO {
72 struct _ft_vft *please; /* INTERCAL style :-) */
73};
74
75#ifndef FT_CORE
77 struct _ft_vft *please; /* INTERCAL style :-) */
79};
80#endif
81
82extern const char *ft_stopword_file;
83extern const char *ft_precompiled_stopwords[];
84
85extern ulong ft_min_word_len;
86extern ulong ft_max_word_len;
87extern ulong ft_query_expansion_limit;
88extern const char *ft_boolean_syntax;
90
91int ft_init_stopwords(void);
92void ft_free_stopwords(void);
93
94/**
95 Operation types, used in FT_HINTS.
96*/
97
99 FT_OP_UNDEFINED, /** Operation undefined, use of hints is impossible */
100 FT_OP_NO, /** No operation, single MATCH function */
101 FT_OP_GT, /** 'Greater than' operation */
102 FT_OP_GE /** 'Greater than or equal to' operation */
104
105#define FT_NL 0 /** Normal mode */
106#define FT_BOOL 1 /** Boolean mode */
107#define FT_SORTED 2 /** perform internal sorting by rank */
108#define FT_EXPAND 4 /** query expansion */
109#define FT_NO_RANKING 8 /** skip rank calculation */
110
111/**
112 Info about FULLTEXT index hints,
113 passed to the storage engine.
114*/
115
116struct ft_hints {
117 /** FULLTEXT flags, see FT_NL, etc */
118 uint flags;
119 /** Operation type */
121 /** Operation value */
122 double op_value;
123 /** LIMIT value, HA_POS_ERROR if not set */
125};
126
127FT_INFO *ft_init_search(uint, void *, uint, uchar *, uint, const CHARSET_INFO *,
128 uchar *);
130
131#endif /* FT_GLOBAL_INCLUDED */
FT_INFO * ft_init_search(uint, void *, uint, uchar *, uint, const CHARSET_INFO *, uchar *)
Definition: ft_static.cc:65
const char * ft_stopword_file
Definition: ft_static.cc:76
struct st_mysql_ftparser ft_default_parser
Definition: ft_static.cc:633
ft_operation
Operation types, used in FT_HINTS.
Definition: ft_global.h:98
@ FT_OP_UNDEFINED
Definition: ft_global.h:99
@ FT_OP_NO
Operation undefined, use of hints is impossible.
Definition: ft_global.h:100
@ FT_OP_GT
No operation, single MATCH function.
Definition: ft_global.h:101
@ FT_OP_GE
'Greater than' operation
Definition: ft_global.h:102
void ft_free_stopwords(void)
Definition: ft_stopwords.cc:132
const char * ft_precompiled_stopwords[]
Definition: ft_static.cc:77
ulong ft_max_word_len
Definition: ft_static.cc:34
ulong ft_min_word_len
Definition: ft_static.cc:33
const char * ft_boolean_syntax
Definition: ft_static.cc:36
int ft_init_stopwords(void)
Definition: ft_stopwords.cc:67
ulong ft_query_expansion_limit
Definition: ft_static.cc:35
bool ft_boolean_check_syntax_string(const uchar *)
Definition: ft_parser.cc:95
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:1140
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:55
unsigned char uchar
Definition: my_inttypes.h:51
Definition: m_ctype.h:422
Definition: ft_global.h:76
struct _ft_vft * please
Definition: ft_global.h:77
struct _ft_vft_ext * could_you
Definition: ft_global.h:78
Definition: ft_global.h:71
struct _ft_vft * please
Definition: ft_global.h:72
Definition: ft_global.h:56
ulonglong(* get_flags)()
Definition: ft_global.h:58
ulonglong(* count_matches)(FT_INFO_EXT *)
Definition: ft_global.h:60
uint(* get_version)()
Definition: ft_global.h:57
ulonglong(* get_docid)(FT_INFO_EXT *)
Definition: ft_global.h:59
Definition: ft_global.h:47
void(* reinit_search)(FT_INFO *)
Definition: ft_global.h:52
float(* find_relevance)(FT_INFO *, uchar *, uint)
Definition: ft_global.h:49
void(* close_search)(FT_INFO *)
Definition: ft_global.h:50
float(* get_relevance)(FT_INFO *)
Definition: ft_global.h:51
int(* read_next)(FT_INFO *, char *)
Definition: ft_global.h:48
Info about FULLTEXT index hints, passed to the storage engine.
Definition: ft_global.h:116
double op_value
Operation value.
Definition: ft_global.h:122
ha_rows limit
LIMIT value, HA_POS_ERROR if not set.
Definition: ft_global.h:124
enum ft_operation op_type
Operation type.
Definition: ft_global.h:120
uint flags
FULLTEXT flags, see FT_NL, etc.
Definition: ft_global.h:118
Definition: plugin_ftparser.h:215