[Groonga-mysql-commit] mroonga/mroonga [master] [wrapper][test] add a test for multi match against conditions in a select.

Zurück zum Archiv-Index

null+****@clear***** null+****@clear*****
2011年 9月 25日 (日) 20:37:40 JST


Kouhei Sutou	2011-09-25 11:37:40 +0000 (Sun, 25 Sep 2011)

  New Revision: 95f52b4ebbe8ea247c95058d17f186e5b0a0a39b

  Log:
    [wrapper][test] add a test for multi match against conditions in a select.

  Added files:
    test/sql/groonga_wrapper/r/fulltext_multiple_index.result
    test/sql/groonga_wrapper/t/fulltext_multiple_index.test

  Added: test/sql/groonga_wrapper/r/fulltext_multiple_index.result (+27 -0) 100644
===================================================================
--- /dev/null
+++ test/sql/groonga_wrapper/r/fulltext_multiple_index.result    2011-09-25 11:37:40 +0000 (f762b7e)
@@ -0,0 +1,27 @@
+drop table if exists diaries;
+create table diaries (
+id int primary key auto_increment,
+title text,
+body text,
+fulltext index title_index (title),
+fulltext index body_index (body)
+) comment = 'engine "innodb"' default charset utf8;
+show create table diaries;
+Table	Create Table
+diaries	CREATE TABLE `diaries` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `title` text,
+  `body` text,
+  PRIMARY KEY (`id`),
+  FULLTEXT KEY `title_index` (`title`),
+  FULLTEXT KEY `body_index` (`body`)
+) ENGINE=groonga DEFAULT CHARSET=utf8 COMMENT='engine "innodb"'
+insert into diaries (title, body) values ("survey", "will start groonga!");
+insert into diaries (title, body) values ("groonga (1)", "starting groonga...");
+insert into diaries (title, body) values ("groonga (2)", "started groonga.");
+select * from diaries
+where match(title) against("survey") and
+match(body) against("groonga");
+id	title	body
+1	survey	will start groonga!
+drop table diaries;

  Added: test/sql/groonga_wrapper/t/fulltext_multiple_index.test (+42 -0) 100644
===================================================================
--- /dev/null
+++ test/sql/groonga_wrapper/t/fulltext_multiple_index.test    2011-09-25 11:37:40 +0000 (6b8bb02)
@@ -0,0 +1,42 @@
+# Copyright(C) 2011 Kouhei Sutou <kou****@clear*****>
+#
+# 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 suite/groonga_include/groonga_init.inc
+
+--disable_warnings
+drop table if exists diaries;
+--enable_warnings
+
+create table diaries (
+  id int primary key auto_increment,
+  title text,
+  body text,
+  fulltext index title_index (title),
+  fulltext index body_index (body)
+) comment = 'engine "innodb"' default charset utf8;
+show create table diaries;
+
+insert into diaries (title, body) values ("survey", "will start groonga!");
+insert into diaries (title, body) values ("groonga (1)", "starting groonga...");
+insert into diaries (title, body) values ("groonga (2)", "started groonga.");
+
+select * from diaries
+  where match(title) against("survey") and
+        match(body) against("groonga");
+
+drop table diaries;
+
+--source suite/groonga_include/groonga_deinit.inc




Groonga-mysql-commit メーリングリストの案内
Zurück zum Archiv-Index