Skip to content
Masafumi Yokoyama edited this page May 29, 2015 · 51 revisions

5.0.4 en

Groonga 5.0.4 has been released!
  http://groonga.org/docs/news.html#release-5-0-4

Install: http://groonga.org/docs/install.html
Charcteristics:  http://groonga.org/docs/characteristic.html

There are following the topics in this release.

* Fixed crash bug which is caused by double free
* Supported to search by 2 or less character even though TokenTrigram is used
* If you are using TokenRegexp, you need to re-create the index

## Fixed crash bug which is caused by double free

If Groonga database is accessed from multiple process or multiple threads, and
when these process or threads update or refer to indexes, Groonga suddenly
crashes by double free memory.

In this release, above bug is fixed.
Upgrade to this new release to avoid Groonga crash bug.

## Supported to search by 2 or less character even though TokenTrigram

In the previous versions, there is a well known case that you can search by one character
even though you use TokenBigram because Groonga specially supports it.

But there was the issue that you can not search token which is less than 3 characters
if TokenTrigram is used.

In this release, Groonga resolves above issue. You can search by token which is
2 or less character even though TokenTrigram is used.

## If you are using TokenRegexp, you need to re-create the index

Fixed a bug that it can't be searched correctly when query contains characters
which are treated as blank character. For example, the newline - "\n" is typical one.
If you are using TokenRegexp, you need to re-create the index.

# Topics

  * [mruby] Changed to use inspect to show meaningful error message for error value.
  * [mruby] Supported Groonga::Bulk#inspect to inspect bulk content.
  * [mruby] Supported Bulk#value to extract the value of record from bulk content.
  * [mruby] Supported estimating size for reference_column == record_id in logical_range_filter.
    In above case, it can be searched more effectively.
  * [sub_filter] Supported index column as scope parameter.
  * [Script syntax] Described clearly about numerical value. [GitHub groonga/groonga.org#16]
    [Suggested by Hiroyuki Sato]
  * [select] Supported accessing other table's record in filter.
    You can use --filter 'OTHER_TABLE[KEY].COLUMN' for example.
  * [select] Supported operator as table key.
    You can use --filter 'OTHER_TABLE["SOME STRING" + "ANOTHER STRING"].COLUMN'" for example.
  * [example] Used Ruby 2.0 or later API in script for converting dictionary data.
  * Changed to show error message about invalid type of keys about table.
  * [doc] Fixed link from sourceforge.jp to osdn.me or osdn.jp about mailing list preference page.
    SourceForge.JP is marked as obsoleted because of branding issue since May 11, 2015.
  * [tokenize] Added force_prefix. [Patch by Naoya Murakami]
  * Supported force prefix search when unmatured token is 2 characters or more. [Patch by Naoya Murakami]
  * [deb] Added service file for Systemd into groonga-httpd and groonga-server-gqtp packages.
  
### Fixes

  * Fixed a crash bug when empty key is specified for drilldown[label].keys.
  * Fixed a bug that the return value of grn_parse_query_flags is not properly checked.
    [GitHub#336] [Reported by Hiroaki Nakamura]
  * Fixed a build error on some BSD systems. They doesn't have "-i" option for sed.
  * Fixed a build error on Solaris. It is changed to initialize by sizeof(msghdr) in memset()
    because msg_control, msg_controllen and msg_flags doesn't exist on Solaris by default.
  * [Tokenizers] Fixed a typo. [GitHub#338] [Reported by Hiroyuki Sato]
  * [Output] Fixed markup. [GitHub groonga/groonga.org#17] [Reported by Hiroyuki Sato]
  * Reduced getenv() in each grn_ii_cursor_set_min(). This fixes performance regression on Windows.
  * Fixed a build error on OpenBSD. [groonga-dev,03255] [Reported by fbnteqr]
  * [groonga-httpd] Fixed a bug that same message is logged.
  * Fixed a crash bug which is caused by double free memory.
  * Fixed a memory leak. It's occurred when --match_columns and --query are used for non indexed
    text field and text fields have a value that isn't bulk embeddable.
    Normally, 32byte over size text isn't bulk embeddable, so this bug doesn't affect to the case
    if only small text less than 32byte are stored.
  * [Tokenizers] [TokenRegexp] Fixed a bug that it can't be searched correctly when query contains
    characters which are treated as blank character. For example, the newline - "\n" is typical one.
    If you are using TokenRegexp, you need to re-create the index.
  
### Thanks

  * Hiroaki Nakamura
  * Hiroyuki Sato
  * Naoya Murakami
  * fbnteqr

5.0.4 ja

  • TokenRegexの修正でインデックスの再作成が必要なことに言及する
  • メーリングリストの投稿先が変わったよというのも
今日は肉の日(5/29)ですね。Groonga 5.0.4をリリースしました。

  http://groonga.org/ja/docs/news.html#release-5-0-4

それぞれの環境毎のインストール方法はこちらを見てください。
  http://groonga.org/ja/docs/install.html

今回のリリースの主なトピックは次の通りです。

* メーリングリストの投稿先がかわりました
* インデックス更新中にクラッシュする不具合を修正
* 2文字以下の文字をTokenTrigramを使っていても検索できるようになりました
* TokenRegexpで空白として扱われる文字が正しく検索できない不具合を修正(インデックスの再構築が必要)

filter関係の機能を強化したり、まれにクラッシュする不具合が修正されているので
アップグレードをおすすめします。

## メーリングリストの投稿先がかわりました

5/11のSourceForge.JPのサイト名変更に伴い、メーリングリストの投稿先がかわりました。

旧: groonga-dev@lists.sourceforge.jp
新: groonga-dev@lists.osdn.me

過去のメールを参照したいときのアーカイブのリンク先も変更になっています。

  http://osdn.jp/projects/groonga/lists/archive/dev/

なお、当面の間は旧アドレスも使うことができます。詳細は以下のURLをご覧ください。

ニュース: サイト名称変更に伴うURL、ドメインの変更についてのお知らせ - OSDN運営・管理 - OSDN
http://osdn.jp/projects/sourceforge/news/24923

ニュース: メーリングリスト移行の際の変更詳細 - OSDN運営・管理 - OSDN
http://osdn.jp/projects/sourceforge/news/24941

## インデックス更新/参照中にクラッシュする不具合を修正

複数のプロセスないしスレッドからGroongaにアクセスしていることに加え
インデックスを更新/参照しているときにまれに意図しないGroongaのクラッシュが発生する
問題を修正しました。
条件によっては二重にメモリを開放してしまうことによるものです。

発生しにくいとはいえ、突然Groongaがクラッシュしてしまうことのないように
アップグレードをおすすめします。

## 2文字以下の文字をTokenTrigramを使っていても検索できるようになりました

これまで、TokenBigramの場合には1文字のクエリであっても、検索できるように
なっていました。(Groonga側でうまく検索できるようにしている)

ただし、それらしい結果を返す仕組みはTokenBigramが前提で、TokenTrigramといった
トークナイザーのことを考慮していませんでした。

今回のリリースでは、TokenTrigramを使っていても2文字以下のクエリで検索できるように
なりました。

## TokenRegexpで空白として扱われる文字が正しく検索できない不具合を修正(インデックスの再構築が必要)

TokenRegexpトークナイザーで、クエリに空白として扱われる文字が含まれている
場合に正しく検索できない不具合を修正しました。典型的な例は改行 ("\n")が含
まれている場合です。例えば、今までは「abcd」「ab\ncd」(\nは改行)にマッチ
していたのですが、今後はマッチしなくなります。なお、この修正により、すでに
TokenRegexpトークナイザーを使っている場合はインデックスの再構築が必要にな
ります。

## 変更点

その他の変更点は以下の通りです。

### 改良

  * [mruby] inspect を意味のあるわかりやすいエラーメッセージを表示するために使うようにしました。
  * [mruby] バルクオブジェクトを調査するための Groonga::Bulk#inspect をサポートしました。
  * [mruby] バルクオブジェクトからレコードの値を取得するための Bulk#value をサポートしました。
  * [mruby] logical_range_filter で参照型のカラムの値が特定のレコードのIDにマッチする場合 
    (reference_column == record_id) を効率良く検索するために必要なマッチするレコード数を
    見積もれるようになりました。
  * [sub_filter] インデックスカラムを scope 引数に指定できるようになりました。
  * [スクリプト構文] 数値に関する記述をよりわかりやすくしました。
    [GitHub groonga/groonga.org#16] [佐藤さんが提案]
  * [select] Select対象でない他のテーブルのレコードをフィルタに指定できるようになりました。
    --filter 'OTHER_TABLE[KEY].COLUMN' といったようにフィルタで指定できます。
  * [select] テーブルのキーでオペレータを指定できるようになりました。 
    --filter 'OTHER_TABLE["SOME STRING" + "ANOTHER STRING"] というように
    キーを連結した文字列として指定することができます。
  * [example] Ruby 2.0以降のAPIを辞書の変換スクリプトで使うようにしました。
  * テーブルのキーの型が正しくないときにエラーメッセージを表示するようにしました。
  * [doc] メーリングリストの案内ページへのリンクをsourceforge.jpからosdn.meやosdn.jpに修正しました。
  * [tokenize] force_prefix を追加しました。[村上さんがパッチ提供]
  * 2文字以上のトークンに対しても前方一致検索を強制できるようにしました。
    TokenBigramで1文字トークンであっても強制前方一致検索することでうまく検索できる仕組みを
    TokenTrigram等でも適用できるようになりました。 [GitHub#341] [村上さんがパッチ提供]
  * [deb] groonga-httpdとgroonga-server-gqtpのパッケージにSystemd用serviceファイルを追加しました。

### 修正

  * 空のキーが drilldown[label].keys に指定されるとクラッシュする不具合を修正しました。
  * grn_parse_query_flags の返り値を適切にチェックしていないのを修正しました。 
    [GitHub#336] [Hiroaki Nakamuraさんが報告]
  * いくつかのBSD系でビルドエラーになる不具合を修正しました。sedに "-i" オプションがないためエラーになっていました。
  * Solarisでビルドエラーになる不具合を修正しました。memset() にて sizeof(msghdr)
    だけ初期化するようにしました。これは Solarisでは msg_control や msg_controllen
    msg_flags、が存在しないためです。
  * [トークナイザー] ドキュメントの誤字を修正しました。[GitHub#338] [佐藤さんが報告]
  * [出力] ドキュメントのマークアップを修正しました。 [GitHub groonga/groonga.org#17] [佐藤さんが報告]
  * grn_ii_cursor_set_min() を呼ぶごとに getenv()しないようにしました。
    これによりWindows上でのパフォーマンスのリグレッションが解決します。
  * OpenBSDでビルドエラーになる不具合を修正しました。 [groonga-dev,03255] [fbnteqrさんが報告]
  * [groonga-httpd] 同じメッセージが重複してログに記録される不具合を修正しました。
  * 二重にメモリを開放することでクラッシュする不具合を修正しました。
  * メモリリークを修正しました。 --match_columns と --query にインデックスを
    張っていないテキストカラムを指定し、そのテキストカラムの内容がバルクオブジェクトに収まりきらないと発生します。
    バルクオブジェクトに収まりきらないのは32byteを越える場合です。
    そのため、テキストがそれよりも短いものばかりならばこの不具合の影響を受けません。
  * [トークナイザー] [TokenRegexp] クエリに空白として扱われる文字が含まれている場合に
    正しく検索できない不具合を修正しました。典型的な例は改行 ("\n")が含まれている場合です。
    この修正により、インデックスの再構築が必要です。

### 感謝

  * Hiroaki Nakamuraさん
  * 佐藤さん
  * 村上さん
  * fbnteqrさん

5.0.3 en

Groonga 5.0.3 has been released!
  http://groonga.org/docs/news.html#release-5-0-3

Install: http://groonga.org/docs/install.html
Charcteristics:  http://groonga.org/docs/characteristic.html

There are following the topics in this release.

* Supported Debian 8.0 (Jessie) and Ubuntu 15.04 (Vivid Vervet)
* [dump] Improved output and supported output customization
* Increased max key size and supported to cache for long query
* [experimental] Supported log rotation

# Topics

## Supported Debian 8.0 (Jessie) and Ubuntu 15.04 (Vivid Vervet)

Supported Debian 8.0 (Jessie) and Ubuntu 15.04 (Vivid Vervet) that
they are released in this month.

See the documents how to installation:

  http://groonga.org/ja/docs/install/debian.html
  http://groonga.org/ja/docs/install/ubuntu.html

## [dump] Improved output and supported output customization

The output of the dump command was improved, so the problem was solved that can't
restore database from the dump.

And, it can specify output by options:

  * --dump_schema <yes (default) or no>
  * --dump_records <yes (default) or no>
  * --dump_indexes <yes (default) or no>

Also, it was newly also supported dump of plugins. It also specifies output
or not as follows:

  * --dump_plugins <yes (default) or no>

## Increased max key size and supported to cache for long query

The cache key is used to distinct for the processed query. In the
previous versions, the query may not be cached
because there is a limitation that too long query is not used as the
cache key.  So far the query more than
4KiB (4,096Byte) is not cached because the max key size is 4KiB.

In this release, the query more than 4KiB is cached because the max
key size is 64KiB - 1 (65,535Byte).

## [experimental] Supported log rotation

Supported log rotation as an experimental feature.

This feature is disabled by default. You can specify threshold for log
rotation. Log file is rotated when log file size is larger than or equals
to the threshold by the following options:

  * groonga.log
    * --log-rotate-threshold-size <threshold>
  * query.log
    * --query-log-rotate-threshold-size <threshold>

5.0.3 ja

  • Debian 8.0(jessie)やUbuntu 15.04(Vivid Vervet)のサポートについて触れる
  • トピックスの候補は以下
    • dumpコマンドの出力が改善したりカスタマイズできるようになった
    • キャッシュのキーサイズの上限値が増えて、長いクエリーでもキャッシュに乗るようになった
    • [実験的] ログローテーションをサポートした
今日は肉の日(4/29)ですね。Groonga 5.0.3をリリースしました。

  http://groonga.org/ja/docs/news.html#release-5-0-3

それぞれの環境毎のインストール方法はこちらを見てください。
  http://groonga.org/ja/docs/install.html

今回のリリースの主なトピックは次の通りです。

* Debian 8.0(Jessie)とUbuntu 15.04(Vivid Vervet)をサポート
* dumpコマンドの出力の改善とオプションによるカスタマイズのサポート
* キーサイズの上限値増加により長いクエリーのキャッシュをサポート
* [実験的] ログローテーションのサポート

## Debian 8.0(Jessie)とUbuntu 15.04(Vivid Vervet)をサポート

今月リリースされたDebian 8.0(Jessie)とUbuntu 15.04(Vivid Vervet)をサポー
トしました。
インストール手順はドキュメントを参照してください。

  http://groonga.org/ja/docs/install/debian.html
  http://groonga.org/ja/docs/install/ubuntu.html

## dumpコマンドの出力の改善とオプションによるカスタマイズのサポート

dumpコマンドの出力を改善し、コマンドの出力順序によってリストアできない場合
がある問題を修正しました。

また、オプションを指定することでほしい情報のみを出力することができるように
なりました。dumpコマンドに指定できるようになったオプションは以下の通りです。

  * スキーマのdumpの有無
    * --dump_schema <yes(デフォルト)またはno>
  * レコードのdumpの有無
    * --dump_records <yes(デフォルト)またはno>
  * インデックスのdumpの有無
    * --dump_indexes <yes(デフォルト)またはno>

それぞれyesまたはnoを指定することで、出力有無を制御することができます。デ
フォルトはyesなので、オプションを指定しない場合は出力されます。

さらに、プラグインのdumpもサポートしました。こちらも以下のように出力の有無
を制御できます。

  * プラグインのdumpの有無
    * --dump_plugins <yes(デフォルト)またはno>

## キーサイズの上限値増加により長いクエリーのキャッシュをサポート

キャッシュのキーにはクエリーを加工した値を使っているのですが、クエリーが
一定以上の長さになるとキーに使えないので、キャッシュが有効になっていても
キャッシュされない場合があります。今まではキャッシュのキーサイズの上限値が
4KiB(4096バイト)だったので、4KiBを超えるクエリーはキャッシュされませんで
した。今回のリリースからは64KiB - 1(65535バイト)に増えたので、4KiBを超え
るクエリーでもキャッシュされるようになりました。

## [実験的] ログローテーションのサポート

実験的な機能として、ログローテーションをサポートしました。今まではログロー
テーションしたい場合は自前でやるか他のライブラリーを使う必要があったのです
が、今回のリリースからはGroongaだけでログローテーションが可能になります。
デフォルトでは無効になっているので、ログローテーションしたい場合はgroonga
コマンドの引数に以下のオプションを追加して、ローテートする閾値のファイル
サイズ(バイト)を指定してください。

  * Groongaプロセスのログ(groonga.log)
    * --log-rotate-threshold-size <閾値>
  * クエリーのログ(query.log)
    * --query-log-rotate-threshold-size <閾値>

## 変更点

その他の変更点は以下の通りです。
  http://groonga.org/ja/docs/news.html#release-5-0-3

5.0.2 en

Groonga 5.0.2 has been released. It's a bug fix release of 5.0.1.
  http://groonga.org/docs/news.html#release-5-0-2

Install: http://groonga.org/docs/install.html
Charcteristics:  http://groonga.org/docs/characteristic.html

## Changes

  * Supported MessagePack 1.0.1. It fixes the build error on Homebrew.

  * Fixed a regression bug that JSONP doesn't work. It was introduced
    in Groonga 4.1.1. Groonga Admin doesn't work by the bug.

  * [windows] Fixed a bug that crash on x86 for Groonga 5.0.1.

  * Fixed a crash bug that libedit is not properly initialized. The
    problem is fixed in the environment such as CentOS 7.

We welcome your feedback!

5.0.2 ja

3/29にGroonga 5.0.1をリリースしましたが、いくつか不具合があったため5.0.2
をリリースしました。以下の変更内容に該当する方は更新をお願いします。

  http://groonga.org/ja/blog/2015/03/31/release.html

  * MessagePack 1.0.1をサポートしました。この対応でHomebrewでビルドでき
    ない問題が解消されます。

  * JSONPが動作していなかった不具合を修正しました。これはGroonga 4.1.1で
    入った不具合で、この影響でGroonga Adminが動作していませんでした。

  * Windowsのx86環境でクラッシュする不具合を修正しました。
    [groonga-dev,03131]で報告してもらった問題です。
    * http://sourceforge.jp/projects/groonga/lists/archive/dev/2015-March/003133.html

  * libeditが正しく初期化されない不具合を修正しました。CentOS 7などの
    環境でクラッシュする問題が解消されます。

それぞれの環境毎のインストール方法はこちらを見てください。
  http://groonga.org/ja/docs/install.html

何か気になったことがあれば、フィードバックをよろしくお願いします。

5.0.1 en

Groonga 5.0.1 has been released!
  http://groonga.org/docs/news.html#release-5-0-1

Install: http://groonga.org/docs/install.html
Charcteristics:  http://groonga.org/docs/characteristic.html

There are following the topics in this release.

* [incompatible] The two incompatible changes for DB API users
* [experimental] Supported regular expression
* Supported to customize score function
* [windows] Supported more compact default database size on Windows
* [experimental] Supported to skip posting list

# Topics

## [incompatible] The two incompatible changes for DB API users

In this release, Internal type of _score was changed from 32bit
integer number to floating point number.  This is incompatible change
for DB API users. This isn't incompatible change for query API
users. It means that users who just use select command aren't
affected. Use the following code that works with both older and newer
Groonga:

  grn_obj *score;
  double score_value;

  if (score->header.domain == GRN_DB_FLOAT) {
    score_value = GRN_FLOAT_VALUE(score);
  } else {
    score_value = (double)GRN_INT32_VALUE_FLOAT_VALUE(score);
  }

Also, custom score function feature introduced API and ABI
incompatibilities in DB API layer. If you're using grn_search_optarg,
please check that your code initializes your grn_search_optarg by 0
like the following:

  grn_search_optarg options;
  memset(&options, 0, sizeof(grn_search_optarg));

If your code do the above thing, your code is API compatible and ABI
incompatible. You just need to rebuild your code without modification.

If your code doesn't the above thing, you need to added the above
thing to your code.

## [experimental] Supported regular expression

In this release, Groonga supports regular expression.

You can use regular expression in select command with query option or 
filter option. Note that syntax is a bit different.

query:

  ${COLUMN}:~${REGULAR_EXPRESSION}

filter:

  ${COLUMN} @~ ${REGULAR_EXPRESSION}

The difference between ":~" and "@~" is come from design of Groonga.

"query" accepts query syntax, on the other hand, "filter" accepts
script syntax.

"filter" is designed for processing more complex search conditions.

You can search by regular expression with index.
Create indexes which meets following the conditions:

  * Lexicon must be TABLE_PAT_KEY table.
  * Lexicon must use TokenRegexp tokenizer.
  * Index column must has WITH_POSITION flag.

Thus, create following the column index.

  table_create RegexpLexicon TABLE_PAT_KEY ShortText \
    --default_tokenizer TokenRegexp \
    --normalizer NormalizerAuto
  column_create RegexpLexicon logs_message_index \
    COLUMN_INDEX|WITH_POSITION Logs message

Then, you can search with regular expression by using index for
message column.

See following the document about regular expression.

  http://groonga.org/docs/reference/regular_expression.html

## Supported to customize score function

In this release, customizing score function feature is supported.

There are two built-in score functions.

  * scorer_tf_idf
    The frequency of "important term" is important for the score
  * scorer_tf_at_most
    The matched count is important, but it doesn't exceed the limit

Groonga use the value of TF (Term Frequency) by default.  For example,
try to search against multiple columns - title column and message
column.

Usually, the content of title column represents summary of message
column.  It is reasonable to give title column the weight.  As a
result, you can search more important records easily.

Note that there is a case that the score of title column with weight
is less than matched message column. It is not intended search results.

If you use scorer_tf_at_most score function, you can limit the value of
score to specific value even though too many records are matched.

See following the scorer document.

  http://groonga.org/docs/reference/scorer.html

## [windows] Supported more compact default database size on Windows

In this release, more compact default database size on Windows is
enabled by default.

In the previous versions, Groonga uses more larger default database size
(128MiB) on Windows. The size of database increases every you create
new column.

It is not efficient, now Groonga supports to expand database size gradually
as same as other GNU/Linux environment.

This feature is introduced since Groonga 4.1.1, but not enabled by default because
it is experimental feature at that time.

Thank you for Groonga users which gives us feedback of above feature!

## [experimental] Supported to skip posting list

In this release, Groonga supports to skip posting list when searching
popular term and rare term at the same time.

It will improve performance. Set GRN_II_CURSOR_SET_MIN_ENABLE
environment variable to 1 to enable the feature.

  GRN_II_CURSOR_SET_MIN_ENABLE=1

The feature is disabled by default because it is experimental feature.

# Changes

## Improvements

  * [logical_range_filter] Supported filter and sort.

  * Supported range search by multiple column index.

  * Added API Overview document for users who want to use Groonga as
    library.

  * [incompatible] Changed internal type of _score to floating point
    number from 32bit integer number. This is incompatible change for DB
    API users. This isn't incompatible change for query API users. It
    means that users who just use select aren't affected. Use the
    following code that works with both older and newer Groonga:

      grn_obj *score;
      double score_value;

      if (score->header.domain == GRN_DB_FLOAT) {
        score_value = GRN_FLOAT_VALUE(score);
      } else {
        score_value = (double)GRN_INT32_VALUE_FLOAT_VALUE(score);
      }

  * [select] Added more strict check for invalid drilldown parameter.
  * Added grn_ctx_get_all_tables(). [Suggested by Masatoshi Teruya]
  * Supported to customize score function. See Scorer for details.
  * [incompatible] Custom score function feature introduced API and
    ABI incompatibilities in DB API layer. If you're using
    grn_search_optarg, please check that your code initializes your
    grn_search_optarg by 0 like the following:

      grn_search_optarg options;
      memset(&options, 0, sizeof(grn_search_optarg));

    * If your code do the above thing, your code is API compatible and
      ABI incompatible. You just need to rebuild your code without
      modification.
    * If your code doesn't the above thing, you need
      to added the above thing to your code.

  * Added the following predicates that check grn_obj type to DB API:
    * grn_obj_is_table()
    * grn_obj_is_proc_proc()
    * grn_obj_is_function_proc()
    * grn_obj_is_selector_proc()
    * grn_obj_is_scorer_proc()

  * [experimental] Supported skipping posting list when searching
    popular term and rare term at the same time. It will improve
    performance. Set GRN_II_CURSOR_SET_MIN_ENABLE environment variable
    to 1 to enable the feature. The feature is disabled by default.

  * [doc] Added in_values document.
  * [doc] Added logical_count document.
  * [mruby] Implemented custom #inspect method. Is is useful for
    debugging.
  * Added scorer_tf_at_most scorer. It limits not to exceed specified
    score regardless of term frequency.
  * [mruby] Supported estimating matched records for selecting index
    search or sequential search.
  * Added the following functions to estimate size by index:
    * grn_expr_estimate_size()
    * grn_ii_estimate_size_for_query()
    * grn_ii_estimate_size_for_lexicon_cursor()
  * Added missing NormalizerAuto availability check. [GitHub#283]
    [Reported by Tasuku SUENAGA]
  * Dropped Visual Studio 2010 support.
  * [experimental][mecab] Supported chunked tokenization. This feature
    is a workaround for MeCab's "too long sentense" error. Specify yes
    to GRN_MECAB_CHUNKED_TOKENIZE_ENABLED environment variable to
    enable it. By this configuration, Groonga splits a long text (8192
    bytes over text by default) into small chunks and passes each
    chunk to MeCab. By this process, the above error isn't
    occurred. Additionally, you can customize chunk threshold bytes by
    GRN_MECAB_CHUNK_SIZE_THRESHOLD environment variable. Note that ,,
    ., !, ?, U+3001 IDEOGRAPHIC COMMA, U+3002 IDEOGRAPHIC FULL STOP,
    U+FF01 FULLWIDTH EXCLAMATION MARK and U+FF1F FULLWIDTH QUESTION
    MARK are treated as chunk delimiter characters.
  * Supported --pid-file in server mode of groonga command.
  * [groonga-httpd] Supported graceful stop to clean Groonga. It
    doesn't terminate the open connections immediately.
  * [experimental] Supported regular expression. See Regular
    expression to know about how to use regular expression.
  * [experimental] Added plugin_unregister command.
  * [http][load] Added "," as chunk separator in POST data. It
    decreases internal buffer size and improves load time when POST
    data don't include any new line.
  * [doc] Added Tokenizers document.
  * Improved POSIX.2 compatibility by using . as bash's "source"
    command replacement. [GitHub#317] [Patch by Jun Kuriyama]
  * [windows] Changed to the default IO version 1. It reduces disk
    usage on Windows. [groonga-dev,03118] [Tested by ongaeshi]
  * [httpd] Updated bundled nginx version to the latest mainline
    (1.7.11).
  * Changed mime-type for TSV output to text/tab-separated-values from
    text/plain.
  * [TokenFilterStopWord] Supported Offline index
    construction. [GitHub#296] [Patch by Naoya Murakami]

## Fixes

  * Fixed not to use obsolete --address parameter in the default
    groonga.conf. --bind-address is used instead. [Groonga-talk]
    [Reported by Dewangga]
  * [truncate] Fixed a bug that TABLE_NO_KEY table can't be truncated.
  * [mecab] Reduced needless logs for "empty token" and "ignore empty token".
  * Fixed a bug that wrong section in index is used. It means that
    wrong search result is returned. If you satisfy all of the following
    conditions, this bug is occurred:
    * Multiple indexes are available.
    * The first defined index or the last defined index are multi-column indexes.
    * When both of the first defined index and the last defined index are
      multi-column indexes, source column orders are different in them.
  * Fixed a bug that passing Groonga command line to groonga command
    from shell command line style usage always returns 0 as exit
    code. For example, groonga DB_PATH nonexistent_command always
    returned 0 as exist code.
  * Fixed a bug that plugin path may be broken when two or more plugins
    registered. [Reported by Naoya Murakami]
  * Fixed a bug that Lexicon.index.source_column_name style in
    match_columns doesn't work when source column specified by
    source_column_name has two or more indexes.
    [Reported by Naoya Murakami]

## Thanks

  * Masatoshi Teruya
  * Tasuku SUENAGA
  * Dewangga
  * Jun Kuriyama
  * ongaeshi
  * Naoya Murakami

5.0.1 ja

今月のアナウンスには次のトピックを入れよう

  • 正規表現のサポート
  • scorerの話
  • GRN_II_CURSOR_SET_MIN_ENABLEの説明
  • APIの非互換についても説明をいれておく
今日は肉の日(3/29)ですね。Groonga 5.0.1をリリースしました!

  http://groonga.org/ja/docs/news.html#release-5-0-1

それぞれの環境毎のインストール方法はこちらを見てください。
  http://groonga.org/ja/docs/install.html

今回のリリースの主なトピックは次の通りです。

* [非互換] スコアに関連したDB APIの非互換な変更があります
* [実験的] 正規表現をサポート
* スコア関数をカスタマイズできるようになりました
* [windows] ディスク使用量を削減しました
* [実験的] 頻出トークンとレアトークンを同時に検索したときの高速化

今回のリリースでは、DB API層に非互換な変更があります。
Groongaをライブラリとして使っている人は、この影響を受けます。
selectコマンドを使って検索するぶんには影響はありません。

## [非互換] スコアに関連したDB APIの非互換な変更があります

今回のリリースではDB API層に非互換な変更がはいりました。
以下の2点を修正する必要があります。

* 内部で使っている_scoreの型の変更に追従する
* grn_search_optargを0で初期化する

新旧のGroongaで正しく動作するようにするには次のように_scoreの
型変更に対応したコードに修正してください。

  grn_obj *score;
  double score_value;

  if (score->header.domain == GRN_DB_FLOAT) {
    score_value = GRN_FLOAT_VALUE(score);
  } else {
    score_value = (double)GRN_INT32_VALUE_FLOAT_VALUE(score);
  }

また、grn_search_optargを次のように0で初期化してください。

  grn_search_optarg options;
  memset(&options, 0, sizeof(grn_search_optarg));

すでに上記のようにしているなら、リビルドしなおす(ABIの変更に追従)だけ
です。

## [実験的] 正規表現をサポート

今回のリリースでは、正規表現を使った検索をサポートしました。

select コマンドの query オプションと filter オプションで正規表現を使え
ます。注意しないといけないのは、query と filterとでは構文がちょっと違
うことです。

queryの場合:

  ${COLUMN}:~${REGULAR_EXPRESSION}

filterの場合:
  ${COLUMN} @~ ${REGULAR_EXPRESSION}

「:~」と「@~」の違いは、Groongaの設計の違いによるものです。

queryはクエリー構文を記述するのに対して、filterにはスクリプト構文を記
述する必要があります。

この構文の違いはfilterのほうが複雑な条件を記述できるように設計されたため
です。

インデックスを使って高速に検索することもできます。
そのためには、次の条件を満すインデックスを作成します。

  * 語彙表は TABLE_PAT_KEY テーブルであること。
  * 語彙表は TokenRegexp トークナイザーを使っていること。
  * インデックスカラムは WITH_POSITION フラグ付きであること。

つまり、次のようなカラムインデックスを作成します。

  table_create RegexpLexicon TABLE_PAT_KEY ShortText \
    --default_tokenizer TokenRegexp \
    --normalizer NormalizerAuto
  column_create RegexpLexicon logs_message_index \
    COLUMN_INDEX|WITH_POSITION Logs message

こうすることで、上記の例だとmessageカラムをインデックスを使って
正規表現による検索をすることができるようになります。

詳細については正規表現のドキュメントを参照してください。

  http://groonga.org/ja/docs/reference/regular_expression.html

## スコア関数をカスタマイズできるようになりました

今回のリリースでは、スコア関数をカスタマイズできるようになりました。

組み込みのスコア関数は2つあります。

  * scorer_tf_idf
    "重要な単語"の出現頻度が高いほどスコアが高くなる
  * scorer_tf_at_most
    マッチすればするほどスコアが高くなるが、一定値を越えない
    ようにする

Groongaは標準でTF(マッチすればするほどスコアが高くなる)を採用していま
す。

例えば、titleとmessageというように複数のカラムに対して検索するケースを
考えてみましょう。

messageの内容をもっともよく表すタイトルをtitleにつけるので、titleのほ
うに重みをつけるとします。そうすることでより重要なものが上位にくるよう
にできますが、messageカラムでマッチ数が多いとその順位が逆転してしまう
ということがありえます。

scorer_tf_at_mostを使うと、たくさんマッチしても最大値はこの値までとい
うように制限することができるます。

そのため、頻出語で検索したときにtitleには含まれていないけど、messageカ
ラムにはたくさん含まれているので検索の上位にきてしまうということがな
いようにできます。

スコアラーの詳細については次のドキュメントを参照してください。

  http://groonga.org/ja/docs/reference/scorer.html

## [windows] ディスク使用量を削減しました

今回のリリースでは、データベースの初期サイズを小さくし、ディスク使用量
を削減する仕組みをデフォルトで有効にしました。これはGroonga 4.1.1では
いった実験的な機能を正式に採用したものです。

これまで、WindowsではGNU/Linuxとは異なりかなりサイズが大きい初期ファイル
(128MiB)をデフォルトで使っていました。

このデータベースファイルはカラムを作れば作るだけ増えていくので、登録し
ているデータが少ない場合にはかなり無駄な領域があることになります。

これはあまり嬉しくないので、WindowsでもGNU/Linux環境と同じように必要に
応じて追加していくようにデフォルトの挙動を変更したのが今回の変更です。

以下のメールに詳しいことが書いてあります。

  [groonga-dev,03036] Windowsでの動作確認のお願い
  http://sourceforge.jp/projects/groonga/lists/archive/dev/2014-December/003038.html

ongaeshiさんがテストに協力してくれました。ありがとうございます!

この変更により、後方互換性(新しいGroongaで古いGroongaのデータベースを
開ける)は保たれますが、前方互換性(古いGroongaで新しいGroongaのデータベー
スを開ける)は失われていることに注意してください。

## [実験的] 頻出トークンとレアトークンを同時に検索したときの高速化

今回のリリースでは、 頻出トークンとレアトークンを同時に検索したときの
検索を高速に行えるようになりました。「同時に」というのがポイントです。
この機能はデフォルトでは無効です。

この機能を有効にするには、次の環境変数を指定する必要があります。

  GRN_II_CURSOR_SET_MIN_ENABLE=1

注意事項として、ある程度のサイズの文書量がないと改善の効果を体感できな
いというのがあります。

この機能の詳細についてはメーリングリストの次の投稿を参照してください。

  http://sourceforge.jp/projects/groonga/lists/archive/dev/2015-February/003097.html

期待通りに改善している報告があつまったらデフォルトで有効にします。

## 変更点

さて、5.0.0からの変更点は以下の通りです。
  http://groonga.org/ja/docs/news.html#release-5-0-1

改良

  * [logical_range_filter] filterとsortをサポートしました。
  * マルチカラムインデックスを使った指定範囲の検索をサポートしました。
  * Groongaをライブラリとして使う人向けにAPIの 概要 を追加しました。
  * [非互換] 内部で使っている _score の型を 32bit整数値から浮動小数点
    に変更しました。この変更はGroongaのDB APIを使っているユーザーにとっ
    て非互換な変更です。クエリAPIを使っているユーザーには影響ありませ
    ん。つまり、select を使っているだけなら影響ないということです。新
    旧のバージョンのGroongaで動作するようにするには次のコードを使いま
    す:

      grn_obj *score;
      double score_value;
  
      if (score->header.domain == GRN_DB_FLOAT) {
        score_value = GRN_FLOAT_VALUE(score);
      } else {
        score_value = (double)GRN_INT32_VALUE_FLOAT_VALUE(score);
      }
  * [select] ドリルダウンの引数の誤りをより厳密にチェックするようにしました。
  * grn_ctx_get_all_tables() を追加しました。 [Masatoshi Teruyaさんが提案]
  * スコア関数のカスタマイズをサポートしました。詳細は Scorer を参照してください。
  * [非互換] スコア関数の導入により、DB API層でAPIとABIの互換性がなく
    なりました。grn_search_optarg を使っていたら、次のようなコードで
    grn_search_optarg を 0 で初期化しているかチェックしてください。:

      grn_search_optarg options;
      memset(&options, 0, sizeof(grn_search_optarg));

    上記のようにしていれば、あなたの書いたコードはAPIの互換性があり、
    ABIは互換性がない状態です。単にそのままリビルドしてください。コー
    ドの修正は不要です。もしあなたの書いたコードが上記のようにしていな
    いなら、上記のコードを追加してください。
  * DB APIに grn_obj の型をチェックするための叙述関数を追加しました。
     * grn_obj_is_table()
     * grn_obj_is_proc_proc()
     * grn_obj_is_function_proc()
     * grn_obj_is_selector_proc()
     * grn_obj_is_scorer_proc()
  * [実験的] ポスティングリストをスキップできるようにしました。頻出語
    とほとんど出現しない語が同時に検索されたときにスキップできます。こ
    れにより検索の速度を改善できます。この機能を有効にするには
    GRN_II_CURSOR_SET_MIN_ENABLE 環境変数を 1 にします。デフォルトでは
    無効です。
  * [doc] in_values のドキュメントを追加しました。
  * logical_count のドキュメントを追加しました。
  * [mruby] #inspect メソッドを実装しました。デバッグに有用です。
  * スコアラー scorer_tf_at_most のドキュメントを追加しました。出現頻度
    が高くても、指定したスコアの閾値を越えないようにします。
  * [mruby] マッチする件数を推定してインデックスを使って検索するかシー
    ケンシャルに検索するかを選択できるようにしました。
  * インデックスを使ってサイズを推定するための関数を追加しました。
     * grn_expr_estimate_size()
     * grn_ii_estimate_size_for_query()
     * grn_ii_estimate_size_for_lexicon_cursor()
  * NormalizerAuto が利用できるかのチェックを追加しました。[GitHub#283]
    [末永さんが報告]
  * Visual Studio 2010のサポートをやめました。
  * [実験的][mecab] チャンクに分割してトークナイズできるようにしました。
    この機能は MeCabの "too long sentense" エラーの回避策です。有効に
    するには GRN_MECAB_CHUNKED_TOKENIZE_ENABLED 環境変数を yes に設定
    します。この設定により、Groonga は長いテキスト (デフォルトでは
    8192 バイトを越えるテキスト)を小さなチャンクと呼ばれるかたまりに分
    割してMeCabへと渡します。この処理により、上記のエラーが発生しない
    ようになります。さらに、このチャンクの閾値は
    GRN_MECAB_CHUNK_SIZE_THRESHOLD 環境変数でカスタマイズできます。,,
    ., !, ?, U+3001 IDEOGRAPHIC COMMA, U+3002 IDEOGRAPHIC FULL STOP,
    U+FF01 FULLWIDTH EXCLAMATION MARK と U+FF1F FULLWIDTH QUESTION
    MARK がチャンクの区切り文字として扱われます。
  * groongaコマンド のサーバーモードで --pid-file をサポートしました。
  * [groonga-httpd] Groongaを緩やかに停止することができるようにしまし
    た。コネクションを即座に強制終了しないようになります。
  * [実験的] 正規表現をサポートしました。正規表現の使いかたについては
    正規表現のドキュメントを参照してください。
  * [実験的] plugin_unregister コマンドを追加しました。
  * [http][load] "," をPOSTデータの区切り文字として使うようにしました。
    これにより、内部のバッファサイズが小さくて済むので、POSTデータに一
    切改行がない場合にロード時間を短縮できます。
  * [doc] トークナイザー のドキュメントを追加しました。
  * POSIX.2 との互換性を改善しました。. bashの "source" コマンドのかわり
    に . を使うようにしました。[GitHub#317] [栗山さんがパッチ提供]
  * [windows] デフォルトのIOバージョンを1に変更しました。これにより
    Windowsでディスク容量を削減できます。[groonga-dev,03118] [ongaeshi
    さんがテスト]
  * [httpd] バンドルしているnginxのバージョンを1.7.11に更新しました。
  * TSV出力時のMIMEタイプを text/plain から text/tab-separated-values
    に変更しました。
  * [TokenFilterStopWord] 静的なインデックス構築方法 をサポートしまし
    た。[GitHub#296] [村上さんがパッチ提供]

修正

  * 非推奨の --address 引数をGroongaのデフォルト設定ファイル
    (groonga.conf)で使わないようにしました。かわりに --bind-address を
    使います。 [Groonga-talk] [Dewanggaさんが報告]
  * [truncate] キーが TABLE_NO_KEY なテーブルでtruncateができない問題
    を修正しました。
  * [mecab] 不必要な "empty token" や "ignore empty token" といったロ
    グが出力されないようにしました。
  * 誤ったインデックスのセクションが使われてしまう不具合を修正しました。
    これにより誤った検索結果を返していました。次の条件をすべて満すと発
    生します。
      * 複数のインデックスが張られている
      * 最初に定義したインデックスか最後に定義したインデックスがマルチカラム
        インデックスを使っている
      * 最初に定義したインデックスと最後に定義したインデックスがマルチ
        カラムインデックスだったとき、そのソースカラムの指定順が異なっ
        ている
  * シェルのコマンドラインからGroongaのコマンドを groongaコマンド に渡
    すと常に 0 を終了コードとして返す不具合を修正しました。 例えば、
    groonga DB_PATH 存在しないコマンド名 を実行しても終了コードとして
    0 を常に返します。
  * 2つ以上のプラグインを登録しているときにプラグインのパスが壊れてし
    まう不具合を修正しました。 [村上さんが報告]
  * match_columns に Lexicon.index.source_column_name を指定しても動作
    しない不具合を修正しました。source_column_name として指定されたカ
    ラムが2つ以上のインデックスをもつ場合に発生します。 [村上さんが報
    告]

感謝

  * Masatoshi Teruyaさん
  * 末永さん
  * Dewanggaさん
  * 栗山さん
  * ongaeshiさん
  * 村上さん
Clone this wiki locally