mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
query expansion for fulltext search
myisam/ft_boolean_search.c: assert.h and queues.h moved to ftdefs.h myisam/ft_parser.c: ft_parse() with alloc myisam/ft_static.c: api changes, ft_max_word_len_for_sort variable removed myisam/ft_update.c: ft_parse() with alloc myisam/ftdefs.h: variable ft_max_word_len_for_sort -> define FT_MAX_WORD_LEN_FOR_SORT api changes, ft_max_word_len_for_sort variable removed ft_parse() with alloc myisam/mi_check.c: variable ft_max_word_len_for_sort -> define FT_MAX_WORD_LEN_FOR_SORT myisam/myisamchk.c: ft_max_word_len_for_sort removed mysql-test/r/fulltext.result: query expansion tests mysql-test/r/fulltext_var.result: ft_max_word_len_for_sort removed mysql-test/t/fulltext.test: query expansion tests sql/ha_myisam.h: ft api changes for query expansion sql/mysqld.cc: ft_max_word_len_for_sort removed ft_query_expansion_limit added sql/set_var.cc: ft_max_word_len_for_sort removed ft_query_expansion_limit added sql/sql_yacc.yy: EXPANSION added to keyword: rule
This commit is contained in:
@ -183,7 +183,7 @@ void ft_parse_init(TREE *wtree, CHARSET_INFO *cs)
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
int ft_parse(TREE *wtree, byte *doc, int doclen)
|
||||
int ft_parse(TREE *wtree, byte *doc, int doclen, my_bool with_alloc)
|
||||
{
|
||||
byte *end=doc+doclen;
|
||||
FT_WORD w;
|
||||
@ -191,6 +191,15 @@ int ft_parse(TREE *wtree, byte *doc, int doclen)
|
||||
|
||||
while (ft_simple_get_word(wtree->custom_arg, &doc,end,&w))
|
||||
{
|
||||
if (with_alloc)
|
||||
{
|
||||
byte *ptr;
|
||||
/* allocating the data in the tree - to avoid mallocs and frees */
|
||||
DBUG_ASSERT(wtree->with_delete==0);
|
||||
ptr=(byte *)alloc_root(& wtree->mem_root,w.len);
|
||||
memcpy(ptr, w.pos, w.len);
|
||||
w.pos=ptr;
|
||||
}
|
||||
if (!tree_insert(wtree, &w, 0, wtree->custom_arg))
|
||||
goto err;
|
||||
}
|
||||
|
Reference in New Issue
Block a user