~mdcallag/+junk/5.1-map

« back to all changes in this revision

Viewing changes to myisam/ftdefs.h

  • Committer: sasha at sashanet
  • Date: 2001-04-12 01:09:00 UTC
  • mfrom: (669.1.1)
  • Revision ID: sp1r-sasha@mysql.sashanet.com-20010412010900-14282
Ugly merge of 3.23 changes into 4.0 - fix up needed

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
2
 
   
 
2
 
3
3
   This program is free software; you can redistribute it and/or modify
4
4
   it under the terms of the GNU General Public License as published by
5
5
   the Free Software Foundation; either version 2 of the License, or
6
6
   (at your option) any later version.
7
 
   
 
7
 
8
8
   This program is distributed in the hope that it will be useful,
9
9
   but WITHOUT ANY WARRANTY; without even the implied warranty of
10
10
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
11
   GNU General Public License for more details.
12
 
   
 
12
 
13
13
   You should have received a copy of the GNU General Public License
14
14
   along with this program; if not, write to the Free Software
15
15
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
23
23
#include <my_tree.h>
24
24
 
25
25
#define MIN_WORD_LEN 4
 
26
#define MAX_WORD_LEN HA_FT_MAXLEN
 
27
#define MAX_WORD_LEN_FOR_SORT 20
26
28
 
27
29
#define HYPHEN_IS_DELIM
28
30
#define HYPHEN_IS_CONCAT     /* not used for now */
29
31
 
30
32
#define COMPILE_STOPWORDS_IN
31
33
 
32
 
/* Most of the formulae were shamelessly stolen from SMART distribution
33
 
   ftp://ftp.cs.cornell.edu/pub/smart/smart.11.0.tar.Z
 
34
/* Interested readers may consult SMART
 
35
   (ftp://ftp.cs.cornell.edu/pub/smart/smart.11.0.tar.Z)
 
36
   for an excellent implementation of vector space model we use.
 
37
   It also demonstrate the usage of different weghting techniques.
 
38
   This code, though, is completely original and is not based on the
 
39
   SMART code but was in some cases inspired by it.
 
40
 
34
41
   NORM_PIVOT was taken from the article
35
42
   A.Singhal, C.Buckley, M.Mitra, "Pivoted Document Length Normalization",
36
43
   ACM SIGIR'96, 21-29, 1996
82
89
#define GWS_ENTROPY (1-(suml/sum-log(sum))/log(aio->info->state->records))
83
90
/*=================================================================*/
84
91
 
 
92
/* Boolean search operators */
 
93
#define FTB_YES   '+'
 
94
#define FTB_NO    '-'
 
95
#define FTB_INC   '>'
 
96
#define FTB_DEC   '<'
 
97
#define FTB_LBR   '('
 
98
#define FTB_RBR   ')'
 
99
#define FTB_NEG   '~'
 
100
#define FTB_TRUNC '*'
 
101
 
 
102
// #define FTB_MAX_SUBEXPR 255
 
103
// #define FTB_MAX_DEPTH   16
 
104
 
85
105
typedef struct st_ft_word {
86
106
  byte * pos;
87
107
  uint   len;
91
111
#endif /* EVAL_RUN */
92
112
} FT_WORD;
93
113
 
 
114
typedef struct st_ftb_param {
 
115
  byte prev;
 
116
  int  yesno;
 
117
  int  plusminus;
 
118
  bool pmsign;
 
119
  bool trunc;
 
120
} FTB_PARAM;
 
121
 
94
122
int is_stopword(char *word, uint len);
 
123
int is_boolean(byte *q, uint len);
95
124
 
96
125
uint _ft_make_key(MI_INFO *, uint , byte *, FT_WORD *, my_off_t);
97
126
 
 
127
byte ft_get_word(byte **, byte *, FT_WORD *, FTB_PARAM *);
 
128
byte ft_simple_get_word(byte **, byte *, FT_WORD *);
 
129
 
98
130
TREE * ft_parse(TREE *, byte *, int);
99
131
FT_WORD * ft_linearize(MI_INFO *, uint, byte *, TREE *);
 
132
FT_WORD * _mi_ft_parserecord(MI_INFO *, uint , byte *, const byte *);
 
133
 
 
134
FT_DOCLIST * ft_nlq_search(MI_INFO *, uint, byte *, uint);
 
135
FT_DOCLIST * ft_boolean_search(MI_INFO *, uint, byte *, uint);
 
136