From: Kouhei S. <ko...@cl...> - 2012-12-29 01:36:06
|
Hi, We released rroonga 2.1.0. You can use rroonga 2.1.0 with the new groonga (2.1.0). http://ranguba.org/#about-rroonga rroonga is the library which ruby-binding for grronga. Since ver.2.0.7 was released, We added the backword incompatible change to rroogna. Groonga::Table#sort returns built-in Ruby Array object until 2.0.8, but now (2.1.0) it returns Groonga::Array. you can use record.value (record is an object of Groonga::Record) to getting returning Array like 2.0.8 beforeby #sort. Please see example below: result_since_2_1_0 = table.sort(["sort_key"]) result_before_2_1_0 = result_since_2_1_0.collect do |record| record.value end However, without record.value, you can get the column values in a record using #{column name} methods, so we recommend it. For example, if you want to get a value of "key" column from a record, you can use record.key instead of record.value.key. We also added the tool to dump index columns from DB, and the method to nomarize string. These tool and method is experimental, so we may change these behavior. In addition, we implemented the feature to delete mass record with block. How to install: % sudo gem install rroonga There is the tutorial of rroonga with irb (Japanese): http://ranguba.org/rroonga/en/file.tutorial.html There is the reference of rroonga (Japanese). http://ranguba.org/rroonga/en/ Please see below changes since ver.2.0.7. http://ranguba.org/rroonga/en/file.news.html 2.1.0: 2012-12-29 ----------------- Improvements ^^^^^^^^^^^^ * Required groonga 2.1.0. * Supported mass record deletion with block. [groonga-dev,01138][Suggested by ongaeshi] * Added Groonga::Normalizer.normalize (experimental). It normalize string. e.g.) Groonga::Normalizer.normalize("AbC") # => "abc" Now, it removes any spaces by default, but it will be customized soon. * Supported :normalizer option in DoubleArrayTrie, PatriciaTrie, Hash, Schema when creating tables. * [table] Added using normalizer accessor. * [table] Used normalizer for checking key normalization is enabled or not. * Added groonga-index-dump tool (experimental). This tool dumps infomations for each index from DB. Dumped informations are contained at "INDEX_NAME.dump" files in "TARGET_TABLE_NAME.index_INDEX_COLUMN_NAME". e.g.) <pre> $ cat index-dump.sdf table_create --name Video --flags TABLE_HASH_KEY --key_type UInt32 table_create --name Tag --flags TABLE_HASH_KEY --key_type ShortText column_create --table Video --name title --flags COLUMN_SCALAR --type ShortText column_create --table Video --name tags --flags COLUMN_VECTOR --type Tag column_create --table Tag --name index_tags --flags COLUMN_INDEX --type Video --source tags load --table Video [ {"_key":1,"title":"groonga Demo","tags":["IT","Server","groonga"]}, {"_key":2,"title":"Ultra Baseball","tags":["Sports","Baseball"]}, ] $ groonga --file index-dump.sdf -n index-dump.db $ groonga-index-dump --output-directory=path/to/index/ index-dump.db $ cd path/to/index/ $ ls Tag.index_tags Baseball.dump IT.dump Server.dump Sports.dump groonga.dump $ cat path/to/index/Tag.index_tags/groonga.dump index: Tag.index_tags term: <groonga> domain: Tag range: Video have_section: false have_weight: false have_position: false weight position term_frequency record 0 2 1 Video[ 1 ].tags </pre> * Added flag options to Groonga::IndexColumn#open_cursor. The flag options are :with_section, :with_weight, :with_position. They are enabled by default if each option is specified in creating a index column. * [Snippet] Showed the error message when specified context wasn't associated with a database by Groonga::Database#open or #create. * [inspect] Supported to display index column related flags for index column only. "index column related flags" are WITH_SECTION, WITH_WEIGHT and WITH_POSITION. * [inspect] Added default tokenizer and normalizer infomation. * Supported Groonga::QueryLogger. This class is used to log query log. Please see its reference for detail. Changes ^^^^^^^ * Move groonga-query-log-extract to groonga-query-log. Please install groogna-query-log gem to use this tool. how to install: gem install groonga-query-log * Returned Groonga::Array instead of Array by Table#sort. [GitHub: #8][Suggested by Genki Takiuchi] CAUTION: This is backward incompatible change. You need to use record.value to get the original record. The following code shows how to use old style: result_since_2_1_0 = table.sort(["sort_key"]) result_before_2_1_0 = result_since_2_1_0.collect do |record| record.value end Thanks ^^^^^^ * ongaeshi * Genki Takiuchi Thanks, -- kou |