[Groonga-mysql-commit] mroonga/mroonga at f0b1ddd [master] test: add a test for "W" pragma without a section

Back to archive index

Kouhei Sutou null+****@clear*****
Thu May 16 11:30:04 JST 2013


Kouhei Sutou	2013-05-16 11:30:04 +0900 (Thu, 16 May 2013)

  New Revision: f0b1ddd20ab77963f33adef5ca1738d444d9f8aa
  https://github.com/mroonga/mroonga/commit/f0b1ddd20ab77963f33adef5ca1738d444d9f8aa

  Message:
    test: add a test for "W" pragma without a section
    
    Not listed sections should be ignored.

  Added files:
    test/sql/suite/mroonga/storage/fulltext/boolean_mode/pragma/weight/r/ignore_section.result
    test/sql/suite/mroonga/storage/fulltext/boolean_mode/pragma/weight/t/ignore_section.test

  Added: test/sql/suite/mroonga/storage/fulltext/boolean_mode/pragma/weight/r/ignore_section.result (+19 -0) 100644
===================================================================
--- /dev/null
+++ test/sql/suite/mroonga/storage/fulltext/boolean_mode/pragma/weight/r/ignore_section.result    2013-05-16 11:30:04 +0900 (d59e295)
@@ -0,0 +1,19 @@
+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:2 +天気" in BOOLEAN MODE) AS score
+FROM diaries
+WHERE MATCH(title, content)
+AGAINST("*W0:2 +天気" in BOOLEAN MODE);
+id	title	content	score
+2	天気	明日の富士山の天気について	2
+DROP TABLE diaries;

  Added: test/sql/suite/mroonga/storage/fulltext/boolean_mode/pragma/weight/t/ignore_section.test (+43 -0) 100644
===================================================================
--- /dev/null
+++ test/sql/suite/mroonga/storage/fulltext/boolean_mode/pragma/weight/t/ignore_section.test    2013-05-16 11:30:04 +0900 (e062e21)
@@ -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:2 +天気" in BOOLEAN MODE) AS score
+       FROM diaries
+       WHERE MATCH(title, content)
+             AGAINST("*W0:2 +天気" in BOOLEAN MODE);
+
+DROP TABLE diaries;
+
+--source include/have_mroonga_deinit.inc
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-mysql-commit mailing list
Back to archive index