ft_global.h 2 KB
Newer Older
1
/* Copyright (C) 2000-2003 MySQL AB
2

unknown's avatar
unknown committed
3 4
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
unknown's avatar
unknown committed
5
   the Free Software Foundation; version 2 of the License.
6

unknown's avatar
unknown committed
7 8 9 10
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
11

unknown's avatar
unknown committed
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */

/* Written by Sergei A. Golubchik, who has a shared copyright to this code */

/* some definitions for full-text indices */

/* #include "myisam.h" */

#ifndef _ft_global_h
#define _ft_global_h
#ifdef  __cplusplus
extern "C" {
#endif

28 29
#define HA_FT_MAXBYTELEN 254
#define HA_FT_MAXCHARLEN (HA_FT_MAXBYTELEN/3)
unknown's avatar
unknown committed
30

31 32
#define DEFAULT_FTB_SYNTAX "+ -><()~*:\"\"&|"

unknown's avatar
unknown committed
33
typedef struct st_ft_info FT_INFO;
34 35
struct _ft_vft
{
unknown's avatar
unknown committed
36
  int       (*read_next)(FT_INFO *, char *);
37
  float     (*find_relevance)(FT_INFO *, uchar *, uint);
unknown's avatar
unknown committed
38 39 40 41 42 43
  void      (*close_search)(FT_INFO *);
  float     (*get_relevance)(FT_INFO *);
  void      (*reinit_search)(FT_INFO *);
};

#ifndef FT_CORE
44 45
struct st_ft_info
{
unknown's avatar
unknown committed
46 47 48
  struct _ft_vft *please; /* INTERCAL style :-) */
};
#endif
unknown's avatar
unknown committed
49

50
extern const char *ft_stopword_file;
51 52
extern const char *ft_precompiled_stopwords[];

53 54
extern ulong ft_min_word_len;
extern ulong ft_max_word_len;
unknown's avatar
unknown committed
55
extern ulong ft_query_expansion_limit;
56
extern const char *ft_boolean_syntax;
57
extern struct st_mysql_ftparser ft_default_parser;
unknown's avatar
unknown committed
58

59
int ft_init_stopwords(void);
60
void ft_free_stopwords(void);
unknown's avatar
unknown committed
61

unknown's avatar
unknown committed
62 63
#define FT_NL     0
#define FT_BOOL   1
64 65 66
#define FT_SORTED 2
#define FT_EXPAND 4   /* query expansion */

67 68
FT_INFO *ft_init_search(uint,void *, uint, uchar *, uint,CHARSET_INFO *, uchar *);
my_bool ft_boolean_check_syntax_string(const uchar *);
unknown's avatar
unknown committed
69 70 71 72 73

#ifdef  __cplusplus
}
#endif
#endif