| 1 | /* Copyright (C) 2006 MySQL AB & MySQL Finland AB & TCX DataKonsult AB |
| 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 Street, Fifth Floor, Boston, MA 02111-1301 USA */ |
| 15 | |
| 16 | /* Written by Sergei A. Golubchik, who has a shared copyright to this code */ |
| 17 | |
| 18 | /* |
| 19 | This function is for interface functions between fulltext and maria |
| 20 | */ |
| 21 | |
| 22 | #include "ma_ftdefs.h" |
| 23 | |
| 24 | FT_INFO *maria_ft_init_search(uint flags, void *info, uint keynr, |
| 25 | uchar *query, size_t query_len, |
| 26 | CHARSET_INFO *cs, uchar *record) |
| 27 | { |
| 28 | FT_INFO *res; |
| 29 | if (flags & FT_BOOL) |
| 30 | res= maria_ft_init_boolean_search((MARIA_HA *) info, keynr, query, |
| 31 | (uint)query_len, cs); |
| 32 | else |
| 33 | res= maria_ft_init_nlq_search((MARIA_HA *) info, keynr, query, (uint)query_len, |
| 34 | flags, record); |
| 35 | return res; |
| 36 | } |
| 37 | |
| 38 | const struct _ft_vft _ma_ft_vft_nlq = { |
| 39 | maria_ft_nlq_read_next, maria_ft_nlq_find_relevance, |
| 40 | maria_ft_nlq_close_search, maria_ft_nlq_get_relevance, |
| 41 | maria_ft_nlq_reinit_search |
| 42 | }; |
| 43 | const struct _ft_vft _ma_ft_vft_boolean = { |
| 44 | maria_ft_boolean_read_next, maria_ft_boolean_find_relevance, |
| 45 | maria_ft_boolean_close_search, maria_ft_boolean_get_relevance, |
| 46 | maria_ft_boolean_reinit_search |
| 47 | }; |
| 48 | |
| 49 | |