diff options
Diffstat (limited to 'storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_different_against.test')
-rw-r--r-- | storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_different_against.test | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_different_against.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_different_against.test new file mode 100644 index 00000000000..eef4e08c5d1 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_different_against.test @@ -0,0 +1,47 @@ +# Copyright(C) 2015 Kouhei Sutou +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library 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 +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS logs; +--enable_warnings + +SET NAMES UTF8; +CREATE TABLE logs( + message TEXT, + FULLTEXT KEY (message) +) DEFAULT CHARSET=utf8; + +INSERT INTO logs VALUES("Error Error Error"); +INSERT INTO logs VALUES("Warning Warning Warning"); +INSERT INTO logs VALUES("Error Error"); +INSERT INTO logs VALUES("Warning Warning"); +INSERT INTO logs VALUES("Error"); +INSERT INTO logs VALUES("Warning"); +INSERT INTO logs VALUES("Error Error Error Error"); +INSERT INTO logs VALUES("Warning Warning Warning Warning"); + +SELECT * FROM logs; + +SELECT *, MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE) AS score + FROM logs + WHERE MATCH(message) AGAINST("Error Warning" IN NATURAL LANGUAGE MODE) + ORDER BY MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE); + +DROP TABLE logs; + +--source ../../include/mroonga/have_mroonga_deinit.inc |