Kouhei Sutou
null+****@clear*****
Thu May 16 11:30:37 JST 2013
Kouhei Sutou 2013-05-16 11:30:37 +0900 (Thu, 16 May 2013) New Revision: 9e00e273a3eae09611cebc353e5c7c9c22cf30a7 https://github.com/mroonga/mroonga/commit/9e00e273a3eae09611cebc353e5c7c9c22cf30a7 Message: test: add a test for "W" pragma without a weight No weight means "1 weight". Added files: test/sql/suite/mroonga/storage/fulltext/boolean_mode/pragma/weight/r/no_weight.result test/sql/suite/mroonga/storage/fulltext/boolean_mode/pragma/weight/t/no_weight.test Added: test/sql/suite/mroonga/storage/fulltext/boolean_mode/pragma/weight/r/no_weight.result (+20 -0) 100644 =================================================================== --- /dev/null +++ test/sql/suite/mroonga/storage/fulltext/boolean_mode/pragma/weight/r/no_weight.result 2013-05-16 11:30:37 +0900 (1b2f202) @@ -0,0 +1,20 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES utf8; +CREATE TABLE diaries ( +id INT PRIMARY KEY, +title VARCHAR(255), +content TEXT, +FULLTEXT INDEX (title, content) +) DEFAULT CHARSET=utf8; +INSERT INTO diaries VALUES(1, "Hello", "今日からはじめました。"); +INSERT INTO diaries VALUES(2, "天気", "明日の富士山の天気について"); +INSERT INTO diaries VALUES(3, "富士山", "今日も天気がよくてきれいに見える。"); +SELECT *, MATCH(title, content) +AGAINST("*W0,1:2 +天気" in BOOLEAN MODE) AS score +FROM diaries +WHERE MATCH(title, content) +AGAINST("*W0,1:2 +天気" in BOOLEAN MODE); +id title content score +2 天気 明日の富士山の天気について 3 +3 富士山 今日も天気がよくてきれいに見える。 2 +DROP TABLE diaries; Added: test/sql/suite/mroonga/storage/fulltext/boolean_mode/pragma/weight/t/no_weight.test (+43 -0) 100644 =================================================================== --- /dev/null +++ test/sql/suite/mroonga/storage/fulltext/boolean_mode/pragma/weight/t/no_weight.test 2013-05-16 11:30:37 +0900 (22d30fe) @@ -0,0 +1,43 @@ +# Copyright(C) 2013 Kouhei Sutou <kou �� clear-code.com> +# +# 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/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE diaries ( + id INT PRIMARY KEY, + title VARCHAR(255), + content TEXT, + FULLTEXT INDEX (title, content) +) DEFAULT CHARSET=utf8; + +INSERT INTO diaries VALUES(1, "Hello", "今日からはじめました。"); +INSERT INTO diaries VALUES(2, "天気", "明日の富士山の天気について"); +INSERT INTO diaries VALUES(3, "富士山", "今日も天気がよくてきれいに見える。"); + +SELECT *, MATCH(title, content) + AGAINST("*W0,1:2 +天気" in BOOLEAN MODE) AS score + FROM diaries + WHERE MATCH(title, content) + AGAINST("*W0,1:2 +天気" in BOOLEAN MODE); + +DROP TABLE diaries; + +--source include/have_mroonga_deinit.inc -------------- next part -------------- HTML����������������������������...ダウンロード