MySQL  8.0.16
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, 2017, Oracle and/or its affiliates. All rights reserved.
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 "m_ctype.h"
38 #include "my_base.h"
39 #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 
46 struct FT_INFO;
47 struct _ft_vft {
48  int (*read_next)(FT_INFO *, char *);
49  float (*find_relevance)(FT_INFO *, uchar *, uint);
50  void (*close_search)(FT_INFO *);
51  float (*get_relevance)(FT_INFO *);
52  void (*reinit_search)(FT_INFO *);
53 };
54 
55 struct FT_INFO_EXT;
56 struct _ft_vft_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 
71 struct FT_INFO {
72  struct _ft_vft *please; /* INTERCAL style :-) */
73 };
74 
75 #ifndef FT_CORE
76 struct FT_INFO_EXT {
77  struct _ft_vft *please; /* INTERCAL style :-) */
79 };
80 #endif
81 
82 extern const char *ft_stopword_file;
83 extern const char *ft_precompiled_stopwords[];
84 
85 extern ulong ft_min_word_len;
86 extern ulong ft_max_word_len;
88 extern const char *ft_boolean_syntax;
90 
91 int ft_init_stopwords(void);
92 void 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 */
103 };
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 
116 struct ft_hints {
117  /** FULLTEXT flags, see FT_NL, etc */
119  /** Operation type */
121  /** Operation value */
122  double op_value;
123  /** LIMIT value, HA_POS_ERROR if not set */
125 };
126 
127 FT_INFO *ft_init_search(uint, void *, uint, uchar *, uint, const CHARSET_INFO *,
128  uchar *);
130 
131 #endif /* FT_GLOBAL_INCLUDED */
int ft_init_stopwords(void)
Definition: ft_stopwords.cc:64
unsigned long long int ulonglong
Definition: my_inttypes.h:69
Definition: ft_global.h:47
unsigned char uchar
Definition: my_inttypes.h:49
Some integer typedefs for easier portability.
Definition: ft_global.h:56
ha_rows limit
LIMIT value, HA_POS_ERROR if not set.
Definition: ft_global.h:124
ulong ft_max_word_len
Definition: ft_static.cc:32
double op_value
Operation value.
Definition: ft_global.h:122
Definition: ft_global.h:99
This file includes constants used by all storage engines.
struct st_mysql_ftparser ft_default_parser
Definition: ft_static.cc:631
bool ft_boolean_check_syntax_string(const uchar *)
Definition: ft_parser.cc:92
struct _ft_vft * please
Definition: ft_global.h:77
ft_operation
Operation types, used in FT_HINTS.
Definition: ft_global.h:98
void(* close_search)(FT_INFO *)
Definition: ft_global.h:50
struct _ft_vft * please
Definition: ft_global.h:72
Definition: ft_global.h:76
unsigned int uint
Definition: uca-dump.cc:29
ulong ft_min_word_len
Definition: ft_static.cc:31
ulonglong(* get_flags)()
Definition: ft_global.h:58
ulong ft_query_expansion_limit
Definition: ft_static.cc:33
FT_INFO * ft_init_search(uint, void *, uint, uchar *, uint, const CHARSET_INFO *, uchar *)
Definition: ft_static.cc:63
Definition: m_ctype.h:358
Definition: plugin_ftparser.h:211
Info about FULLTEXT index hints, passed to the storage engine.
Definition: ft_global.h:116
No operation, single MATCH function.
Definition: ft_global.h:101
ulonglong(* get_docid)(FT_INFO_EXT *)
Definition: ft_global.h:59
void ft_free_stopwords(void)
Definition: ft_stopwords.cc:129
uint flags
FULLTEXT flags, see FT_NL, etc.
Definition: ft_global.h:118
&#39;Greater than&#39; operation
Definition: ft_global.h:102
float(* find_relevance)(FT_INFO *, uchar *, uint)
Definition: ft_global.h:49
void(* reinit_search)(FT_INFO *)
Definition: ft_global.h:52
enum ft_operation op_type
Operation type.
Definition: ft_global.h:120
uint(* get_version)()
Definition: ft_global.h:57
const char * ft_precompiled_stopwords[]
Definition: ft_static.cc:75
A better implementation of the UNIX ctype(3) library.
const char * ft_stopword_file
Definition: ft_static.cc:74
Definition: ft_global.h:71
const char * ft_boolean_syntax
Definition: ft_static.cc:34
float(* get_relevance)(FT_INFO *)
Definition: ft_global.h:51
Operation undefined, use of hints is impossible.
Definition: ft_global.h:100
ulonglong(* count_matches)(FT_INFO_EXT *)
Definition: ft_global.h:60
unsigned long ulong
Definition: my_inttypes.h:46
my_off_t ha_rows
Definition: my_base.h:1066
struct _ft_vft_ext * could_you
Definition: ft_global.h:78
int(* read_next)(FT_INFO *, char *)
Definition: ft_global.h:48