[Groonga-mysql-commit] mroonga/mroonga.github.com at 4891911 [master] blog en: add more concrete example about W pragma

アーカイブの一覧に戻る

HAYASHI Kentaro null+****@clear*****
Wed Jan 29 14:47:48 JST 2014


HAYASHI Kentaro	2014-01-29 14:47:48 +0900 (Wed, 29 Jan 2014)

  New Revision: 489191197cfe74f395ccbf4e008d75c8520657cf
  https://github.com/mroonga/mroonga.github.com/commit/489191197cfe74f395ccbf4e008d75c8520657cf

  Message:
    blog en: add more concrete example about W pragma

  Modified files:
    en/_posts/2014-01-29-release.textile

  Modified: en/_posts/2014-01-29-release.textile (+28 -0)
===================================================================
--- en/_posts/2014-01-29-release.textile    2014-01-29 14:38:40 +0900 (abf8b0b)
+++ en/_posts/2014-01-29-release.textile    2014-01-29 14:47:48 +0900 (1c5ff32)
@@ -17,6 +17,8 @@ Here is the topics for this release:
 * Supported to customize lock timeout
 * Improved compatibility with Tritonn's W pragma
 
+If you are using pragma in SQLs, you need change your query for Mroonga 3.12 or later.
+
 h3. Supported to customize lock timeout
 
 In this release, it makes lock timeout customizable now.
@@ -49,6 +51,32 @@ By above changes, Mroonga's behaviour is same as Tritonn.
 
 As this is imcopatible changes, please check existing query which is affected.
 
+Here is the concrete example using multiple column index for title column and comment column.
+
+<pre>
+CREATE TABLE books (
+  `id` INTEGER AUTO_INCREMENT,
+  `title` text,
+  `comment` text,
+  PRIMARY KEY(`id`),
+  FULLTEXT INDEX content_index (title, comment)
+) engine=mroonga default charset utf8;
+</pre>
+
+In the previous versions, as Mroonga uses 0-origin, here is the query which uses 10 weight for title column, 1 weight for comment column.
+
+<pre>
+SELECT title, comment, MATCH (title,comment) AGAINST('*W0:10,1:1 +Groonga' IN BOOLEAN MODE) AS score FROM books;
+</pre>
+
+The title column matches section number 0, the comment column matches section number 1 in above query.
+
+After Mroonga 3.12, as Mroonga uses 1-origin, the title column matches section number 1, the comment column matches section number 2 in above query. Here is the rewrited query for Mroonga 3.12 or later.
+
+<pre>
+SELECT title, comment, MATCH (title,comment) AGAINST('*W1:10,2:1 +Groonga' IN BOOLEAN MODE) AS score FROM books;
+</pre>
+
 h3. Conclusion
 
 See "Release 3.12 - 2014/01/29":/docs/news.html#release-3-12 about detailed changes since 3.11.
-------------- next part --------------
HTML����������������������������...
ダウンロード 



More information about the Groonga-mysql-commit mailing list
アーカイブの一覧に戻る