MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ft_global.h
1 /* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
2 
3  This program is free software; you can redistribute it and/or modify
4  it under the terms of the GNU General Public License as published by
5  the Free Software Foundation; version 2 of the License.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  GNU General Public License for more details.
11 
12  You should have received a copy of the GNU General Public License
13  along with this program; if not, write to the Free Software
14  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
15 
16 /* Written by Sergei A. Golubchik, who has a shared copyright to this code */
17 
18 /* some definitions for full-text indices */
19 
20 /* #include "myisam.h" */
21 
22 #ifndef _ft_global_h
23 #define _ft_global_h
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 #define HA_FT_MAXBYTELEN 254
29 #define HA_FT_MAXCHARLEN (HA_FT_MAXBYTELEN/3)
30 
31 #define DEFAULT_FTB_SYNTAX "+ -><()~*:\"\"&|"
32 
33 typedef struct st_ft_info FT_INFO;
34 struct _ft_vft
35 {
36  int (*read_next)(FT_INFO *, char *);
37  float (*find_relevance)(FT_INFO *, uchar *, uint);
38  void (*close_search)(FT_INFO *);
39  float (*get_relevance)(FT_INFO *);
40  void (*reinit_search)(FT_INFO *);
41 };
42 
43 typedef struct st_ft_info_ext FT_INFO_EXT;
45 {
46  uint (*get_version)(); // Extended API version
47  ulonglong (*get_flags)();
48  ulonglong (*get_docid)(FT_INFO_EXT *);
49  ulonglong (*count_matches)(FT_INFO_EXT *);
50 };
51 
52 /* Flags for extended FT API */
53 #define FTS_ORDERED_RESULT (LL(1) << 1)
54 #define FTS_DOCID_IN_RESULT (LL(1) << 2)
55 
56 #define FTS_DOC_ID_COL_NAME "FTS_DOC_ID"
57 
58 #ifndef FT_CORE
59 struct st_ft_info
60 {
61  struct _ft_vft *please; /* INTERCAL style :-) */
62 };
63 
65 {
66  struct _ft_vft *please; /* INTERCAL style :-) */
67  struct _ft_vft_ext *could_you;
68 };
69 #endif
70 
71 extern const char *ft_stopword_file;
72 extern const char *ft_precompiled_stopwords[];
73 
74 extern ulong ft_min_word_len;
75 extern ulong ft_max_word_len;
76 extern ulong ft_query_expansion_limit;
77 extern const char *ft_boolean_syntax;
78 extern struct st_mysql_ftparser ft_default_parser;
79 
80 int ft_init_stopwords(void);
81 void ft_free_stopwords(void);
82 
83 #define FT_NL 0
84 #define FT_BOOL 1
85 #define FT_SORTED 2
86 #define FT_EXPAND 4 /* query expansion */
87 
88 FT_INFO *ft_init_search(uint,void *, uint, uchar *, uint,
89  const CHARSET_INFO *, uchar *);
90 my_bool ft_boolean_check_syntax_string(const uchar *);
91 
92 #ifdef __cplusplus
93 }
94 #endif
95 #endif