BloGroonga

2019-01-29

Groonga 8.1.1 has been released

Groonga 8.1.1 has been released!

How to install: Install

Changes

Here are important changes in this release:

  • logical_select Added new argument --load_table, --load_columns and --load_values.

  • groonga executable file Added a new option --log-flags.

  • Fixed a memory leak when occurs index update error.

  • Normalizers Fixed a bug that stateless normalizers and stateful normalizers return wrong results when we use them at the same time.

    • Stateless normalizers are below.

      • unify_kana
      • unify_kana_case
      • unify_kana_voiced_sound_mark
      • unify_hyphen
      • unify_prolonged_sound_mark
      • unify_hyphen_and_prolonged_sound_mark
      • unify_middle_dot
    • Stateful normalizers are below.

      • unify_katakana_v_sounds
      • unify_katakana_bu_sound
      • unify_to_romaji

logical_select Added new argument --load_table, --load_columns and --load_values.

We can store a result of logical_select in a table that specifying --load_table.

--load_values option specifies columns of result of logical_select.

--load_columns options specifies columns of table that specifying --load_table.

In this way, you can store values of columns that specifying with --load_values into columns that specifying with --load_columns.

For example, we can store _id and timestamp that a result of logical_select in a Logs table specified by --load_table as below.

table_create Logs_20150203 TABLE_HASH_KEY ShortText
column_create Logs_20150203 timestamp COLUMN_SCALAR Time

table_create Logs_20150204 TABLE_HASH_KEY ShortText
column_create Logs_20150204 timestamp COLUMN_SCALAR Time

table_create Logs TABLE_HASH_KEY ShortText
column_create Logs original_id COLUMN_SCALAR UInt32
column_create Logs timestamp_text COLUMN_SCALAR ShortText

load --table Logs_20150203
[
{
  "_key": "2015-02-03:1",
  "timestamp": "2015-02-03 10:49:00"
},
{
  "_key": "2015-02-03:2",
  "timestamp": "2015-02-03 12:49:00"
}
]

load --table Logs_20150204
[
{
  "_key": "2015-02-04:1",
  "timestamp": "2015-02-04 00:00:00"
}
]

logical_select \
  --logical_table Logs \
  --shard_key timestamp \
  --load_table Logs \
  --load_columns "original_id, timestamp_text" \
  --load_values "_id, timestamp"
[
  [
    0,
    0.0,
    0.0
  ],
  [
    [
      [
        3
      ],
      [
        [
          "_id",
          "UInt32"
        ],
        [
          "_key",
          "ShortText"
        ],
        [
          "timestamp",
          "Time"
        ]
      ],
      [
        1,
        "2015-02-03:1",
        1422928140.0
      ],
      [
        2,
        "2015-02-03:2",
        1422935340.0
      ],
      [
        1,
        "2015-02-04:1",
        1422975600.0
      ]
    ]
  ]
]
select --table Logs
[
  [
    0,
    0.0,
    0.0
  ],
  [
    [
      [
        3
      ],
      [
        [
          "_id",
          "UInt32"
        ],
        [
          "_key",
          "ShortText"
        ],
        [
          "original_id",
          "UInt32"
        ],
        [
          "timestamp_text",
          "ShortText"
        ]
      ],
      [
        1,
        "2015-02-03:1",
        1,
        "1422928140000000"
      ],
      [
        2,
        "2015-02-03:2",
        2,
        "1422935340000000"
      ],
      [
        3,
        "2015-02-04:1",
        1,
        "1422975600000000"
      ]
    ]
  ]
]

groonga executable file Added a new option --log-flags.

We can specify output items of a log of the Groonga.

We can output as below items.

  • Timestamp
  • Log message
  • Location(the location where the log was output)
  • Process id
  • Thread id

We can specify prefix as below.

  • +

    • This prefix means that "add the flag".
  • -

    • This prefix means that "remove the flag".
  • No prefix means that "replace existing flags".

Specifically, we can specify flags as below.

  • none

    • Output nothing into the log.
  • time

    • Output a timestamp into the log.
  • message

    • Output log messages into the log.
  • location

    • Output the location where the log was output( a file name, a line and a function name) and process id.
  • process_id

    • Output a process id into the log.
  • pid

    • This flag is an alias of process_id.
  • thread_id

    • Output thread id into the log.
  • all

    • This flag specifies all flags except none and default flags.
  • default

    • Output a timestamp and log messages into the log.

We can also specify multiple log flags by separating flags with |.

For example, we can output process id and thread id additional as below.

Execute command
% groonga --log-path groonga.log --log-flags "+pid|+thread_id" db/test.db

Result format
Timestamp|Log level|process id|thread id: Log message

Result
2019-01-29 08:53:03.587000|n|2344|3228: grn_init: <8.1.1-xx-xxxxxxxx>

Conclusion

See Release 8.1.1 2019-01-29 about detailed changes since 8.1.0

Let's search by Groonga!