rroonga 4.0.0-x86-mingw32 → 4.0.1-x86-mingw32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/.yardopts +6 -0
 - data/doc/text/news.textile +26 -0
 - data/ext/groonga/rb-grn-column.c +42 -2
 - data/ext/groonga/rb-grn-index-column.c +57 -159
 - data/ext/groonga/rb-grn-object.c +7 -0
 - data/ext/groonga/rb-grn-table.c +19 -3
 - data/ext/groonga/rb-grn-utils.c +4 -1
 - data/ext/groonga/rb-grn-variable-size-column.c +405 -5
 - data/ext/groonga/rb-grn.h +18 -1
 - data/lib/1.9/groonga.so +0 -0
 - data/lib/2.0/groonga.so +0 -0
 - data/lib/2.1/groonga.so +0 -0
 - data/lib/groonga/dumper.rb +46 -22
 - data/lib/groonga/expression-builder.rb +2 -4
 - data/lib/groonga/schema.rb +16 -234
 - data/rroonga-build.rb +3 -3
 - data/rroonga.gemspec +1 -1
 - data/test/test-array.rb +6 -5
 - data/test/test-column.rb +0 -14
 - data/test/test-database.rb +6 -5
 - data/test/test-double-array-trie.rb +6 -5
 - data/test/test-expression.rb +2 -2
 - data/test/test-hash.rb +6 -5
 - data/test/test-index-column.rb +163 -33
 - data/test/test-patricia-trie.rb +6 -5
 - data/test/test-schema-dumper.rb +39 -7
 - data/test/test-table-dumper.rb +46 -1
 - data/test/test-table-select-weight.rb +12 -0
 - data/test/test-variable-size-column.rb +87 -3
 - data/vendor/local/bin/groonga-benchmark.exe +0 -0
 - data/vendor/local/bin/groonga.exe +0 -0
 - data/vendor/local/bin/libgroonga-0.dll +0 -0
 - data/vendor/local/bin/libmecab-1.dll +0 -0
 - data/vendor/local/bin/libmsgpack-3.dll +0 -0
 - data/vendor/local/bin/libmsgpackc-2.dll +0 -0
 - data/vendor/local/bin/mecab.exe +0 -0
 - data/vendor/local/include/groonga/groonga.h +6 -1
 - data/vendor/local/lib/groonga/plugins/query_expanders/tsv.a +0 -0
 - data/vendor/local/lib/groonga/plugins/query_expanders/tsv.dll +0 -0
 - data/vendor/local/lib/groonga/plugins/query_expanders/tsv.dll.a +0 -0
 - data/vendor/local/lib/groonga/plugins/suggest/suggest.a +0 -0
 - data/vendor/local/lib/groonga/plugins/suggest/suggest.dll +0 -0
 - data/vendor/local/lib/groonga/plugins/suggest/suggest.dll.a +0 -0
 - data/vendor/local/lib/groonga/plugins/table/table.a +0 -0
 - data/vendor/local/lib/groonga/plugins/table/table.dll +0 -0
 - data/vendor/local/lib/groonga/plugins/table/table.dll.a +0 -0
 - data/vendor/local/lib/groonga/plugins/tokenizers/mecab.a +0 -0
 - data/vendor/local/lib/groonga/plugins/tokenizers/mecab.dll +0 -0
 - data/vendor/local/lib/groonga/plugins/tokenizers/mecab.dll.a +0 -0
 - data/vendor/local/lib/libgroonga.a +0 -0
 - data/vendor/local/lib/libgroonga.dll.a +0 -0
 - data/vendor/local/lib/libmecab.a +0 -0
 - data/vendor/local/lib/libmecab.dll.a +0 -0
 - data/vendor/local/lib/libmsgpack.a +0 -0
 - data/vendor/local/lib/libmsgpack.dll.a +0 -0
 - data/vendor/local/lib/libmsgpackc.a +0 -0
 - data/vendor/local/lib/libmsgpackc.dll.a +0 -0
 - data/vendor/local/lib/pkgconfig/groonga.pc +2 -2
 - data/vendor/local/libexec/mecab/mecab-cost-train.exe +0 -0
 - data/vendor/local/libexec/mecab/mecab-dict-gen.exe +0 -0
 - data/vendor/local/libexec/mecab/mecab-dict-index.exe +0 -0
 - data/vendor/local/libexec/mecab/mecab-system-eval.exe +0 -0
 - data/vendor/local/libexec/mecab/mecab-test-gen.exe +0 -0
 - data/vendor/local/share/doc/groonga/en/html/.buildinfo +1 -1
 - data/vendor/local/share/doc/groonga/en/html/_sources/install/centos.txt +3 -3
 - data/vendor/local/share/doc/groonga/en/html/_sources/install/debian.txt +3 -3
 - data/vendor/local/share/doc/groonga/en/html/_sources/install/fedora.txt +3 -3
 - data/vendor/local/share/doc/groonga/en/html/_sources/install/mac_os_x.txt +3 -3
 - data/vendor/local/share/doc/groonga/en/html/_sources/install/others.txt +3 -3
 - data/vendor/local/share/doc/groonga/en/html/_sources/install/solaris.txt +3 -3
 - data/vendor/local/share/doc/groonga/en/html/_sources/install/ubuntu.txt +3 -3
 - data/vendor/local/share/doc/groonga/en/html/_sources/install/windows.txt +9 -9
 - data/vendor/local/share/doc/groonga/en/html/_sources/news.txt +41 -0
 - data/vendor/local/share/doc/groonga/en/html/_sources/reference/column.txt +25 -0
 - data/vendor/local/share/doc/groonga/en/html/_sources/reference/columns/vector.txt +333 -0
 - data/vendor/local/share/doc/groonga/en/html/_sources/reference/commands/cache_limit.txt +1 -1
 - data/vendor/local/share/doc/groonga/en/html/_sources/reference/commands/column_create.txt +1 -2
 - data/vendor/local/share/doc/groonga/en/html/_sources/reference/commands/column_rename.txt +37 -17
 - data/vendor/local/share/doc/groonga/en/html/_sources/reference/commands/delete.txt +4 -5
 - data/vendor/local/share/doc/groonga/en/html/_sources/reference/commands/normalize.txt +1 -2
 - data/vendor/local/share/doc/groonga/en/html/_sources/reference/commands/select.txt +99 -0
 - data/vendor/local/share/doc/groonga/en/html/_sources/reference/commands/table_create.txt +1 -1
 - data/vendor/local/share/doc/groonga/en/html/_sources/reference/commands/truncate.txt +1 -2
 - data/vendor/local/share/doc/groonga/en/html/_sources/reference/executables/groonga-suggest-httpd.txt +128 -4
 - data/vendor/local/share/doc/groonga/en/html/_sources/reference/executables/groonga-suggest-learner.txt +11 -1
 - data/vendor/local/share/doc/groonga/en/html/_sources/reference.txt +3 -2
 - data/vendor/local/share/doc/groonga/en/html/_static/basic.css +1 -1
 - data/vendor/local/share/doc/groonga/en/html/_static/doctools.js +1 -1
 - data/vendor/local/share/doc/groonga/en/html/_static/searchtools.js +1 -1
 - data/vendor/local/share/doc/groonga/en/html/_static/websupport.js +1 -1
 - data/vendor/local/share/doc/groonga/en/html/characteristic.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/community.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/contribution/development/com.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/contribution/development/cooperation.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/contribution/development/document.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/contribution/development/query.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/contribution/development/release.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/contribution/development/repository.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/contribution/development/test.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/contribution/development.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/contribution/documentation/c-api.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/contribution/documentation/i18n.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/contribution/documentation.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/contribution/report.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/contribution.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/development/travis-ci.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/development.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/genindex.html +11 -11
 - data/vendor/local/share/doc/groonga/en/html/geolocation_search.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/index.html +68 -67
 - data/vendor/local/share/doc/groonga/en/html/install/centos.html +8 -8
 - data/vendor/local/share/doc/groonga/en/html/install/debian.html +8 -8
 - data/vendor/local/share/doc/groonga/en/html/install/fedora.html +8 -8
 - data/vendor/local/share/doc/groonga/en/html/install/mac_os_x.html +8 -8
 - data/vendor/local/share/doc/groonga/en/html/install/others.html +8 -8
 - data/vendor/local/share/doc/groonga/en/html/install/solaris.html +8 -8
 - data/vendor/local/share/doc/groonga/en/html/install/ubuntu.html +8 -8
 - data/vendor/local/share/doc/groonga/en/html/install/windows.html +14 -14
 - data/vendor/local/share/doc/groonga/en/html/install.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/limitations.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/news/0.x.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/news/1.0.x.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/news/1.1.x.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/news/1.2.x.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/news/senna.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/news.html +247 -200
 - data/vendor/local/share/doc/groonga/en/html/objects.inv +0 -0
 - data/vendor/local/share/doc/groonga/en/html/reference/api/global_configurations.html +24 -24
 - data/vendor/local/share/doc/groonga/en/html/reference/api/grn_cache.html +26 -26
 - data/vendor/local/share/doc/groonga/en/html/reference/api/grn_column.html +26 -26
 - data/vendor/local/share/doc/groonga/en/html/reference/api/grn_command_version.html +26 -26
 - data/vendor/local/share/doc/groonga/en/html/reference/api/grn_ctx.html +26 -26
 - data/vendor/local/share/doc/groonga/en/html/reference/api/grn_db.html +26 -26
 - data/vendor/local/share/doc/groonga/en/html/reference/api/grn_encoding.html +26 -26
 - data/vendor/local/share/doc/groonga/en/html/reference/api/grn_expr.html +24 -24
 - data/vendor/local/share/doc/groonga/en/html/reference/api/grn_geo.html +26 -26
 - data/vendor/local/share/doc/groonga/en/html/reference/api/grn_hook.html +26 -26
 - data/vendor/local/share/doc/groonga/en/html/reference/api/grn_ii.html +26 -26
 - data/vendor/local/share/doc/groonga/en/html/reference/api/grn_index_cursor.html +26 -26
 - data/vendor/local/share/doc/groonga/en/html/reference/api/grn_info.html +26 -26
 - data/vendor/local/share/doc/groonga/en/html/reference/api/grn_match_escalation.html +26 -26
 - data/vendor/local/share/doc/groonga/en/html/reference/api/grn_obj.html +26 -26
 - data/vendor/local/share/doc/groonga/en/html/reference/api/grn_proc.html +26 -26
 - data/vendor/local/share/doc/groonga/en/html/reference/api/grn_search.html +26 -26
 - data/vendor/local/share/doc/groonga/en/html/reference/api/grn_table.html +26 -26
 - data/vendor/local/share/doc/groonga/en/html/reference/api/grn_table_cursor.html +26 -26
 - data/vendor/local/share/doc/groonga/en/html/reference/api/grn_type.html +26 -26
 - data/vendor/local/share/doc/groonga/en/html/reference/api/grn_user_data.html +22 -22
 - data/vendor/local/share/doc/groonga/en/html/reference/api.html +38 -38
 - data/vendor/local/share/doc/groonga/en/html/reference/cast.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/reference/column.html +153 -0
 - data/vendor/local/share/doc/groonga/en/html/reference/columns/vector.html +857 -0
 - data/vendor/local/share/doc/groonga/en/html/reference/command/command_version.html +7 -7
 - data/vendor/local/share/doc/groonga/en/html/reference/command/output_format.html +7 -7
 - data/vendor/local/share/doc/groonga/en/html/reference/command/return_code.html +7 -7
 - data/vendor/local/share/doc/groonga/en/html/reference/command.html +8 -8
 - data/vendor/local/share/doc/groonga/en/html/reference/commands/cache_limit.html +8 -8
 - data/vendor/local/share/doc/groonga/en/html/reference/commands/check.html +7 -7
 - data/vendor/local/share/doc/groonga/en/html/reference/commands/clearlock.html +7 -7
 - data/vendor/local/share/doc/groonga/en/html/reference/commands/column_create.html +8 -9
 - data/vendor/local/share/doc/groonga/en/html/reference/commands/column_list.html +7 -7
 - data/vendor/local/share/doc/groonga/en/html/reference/commands/column_remove.html +7 -7
 - data/vendor/local/share/doc/groonga/en/html/reference/commands/column_rename.html +47 -26
 - data/vendor/local/share/doc/groonga/en/html/reference/commands/define_selector.html +7 -7
 - data/vendor/local/share/doc/groonga/en/html/reference/commands/defrag.html +7 -7
 - data/vendor/local/share/doc/groonga/en/html/reference/commands/delete.html +8 -9
 - data/vendor/local/share/doc/groonga/en/html/reference/commands/dump.html +7 -7
 - data/vendor/local/share/doc/groonga/en/html/reference/commands/load.html +7 -7
 - data/vendor/local/share/doc/groonga/en/html/reference/commands/log_level.html +7 -7
 - data/vendor/local/share/doc/groonga/en/html/reference/commands/log_put.html +7 -7
 - data/vendor/local/share/doc/groonga/en/html/reference/commands/log_reopen.html +7 -7
 - data/vendor/local/share/doc/groonga/en/html/reference/commands/normalize.html +10 -10
 - data/vendor/local/share/doc/groonga/en/html/reference/commands/quit.html +7 -7
 - data/vendor/local/share/doc/groonga/en/html/reference/commands/register.html +7 -7
 - data/vendor/local/share/doc/groonga/en/html/reference/commands/ruby_eval.html +7 -7
 - data/vendor/local/share/doc/groonga/en/html/reference/commands/ruby_load.html +7 -7
 - data/vendor/local/share/doc/groonga/en/html/reference/commands/select.html +193 -7
 - data/vendor/local/share/doc/groonga/en/html/reference/commands/shutdown.html +7 -7
 - data/vendor/local/share/doc/groonga/en/html/reference/commands/status.html +12 -12
 - data/vendor/local/share/doc/groonga/en/html/reference/commands/suggest.html +7 -7
 - data/vendor/local/share/doc/groonga/en/html/reference/commands/table_create.html +8 -8
 - data/vendor/local/share/doc/groonga/en/html/reference/commands/table_list.html +7 -7
 - data/vendor/local/share/doc/groonga/en/html/reference/commands/table_remove.html +7 -7
 - data/vendor/local/share/doc/groonga/en/html/reference/commands/tokenize.html +7 -7
 - data/vendor/local/share/doc/groonga/en/html/reference/commands/truncate.html +8 -9
 - data/vendor/local/share/doc/groonga/en/html/reference/executables/grnslap.html +7 -7
 - data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-benchmark.html +7 -7
 - data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-httpd.html +10 -10
 - data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-server-http.html +7 -7
 - data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-suggest-create-dataset.html +7 -7
 - data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-suggest-httpd.html +165 -13
 - data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-suggest-learner.html +25 -8
 - data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga.html +7 -7
 - data/vendor/local/share/doc/groonga/en/html/reference/executables.html +12 -12
 - data/vendor/local/share/doc/groonga/en/html/reference/function.html +28 -28
 - data/vendor/local/share/doc/groonga/en/html/reference/functions/between.html +40 -40
 - data/vendor/local/share/doc/groonga/en/html/reference/functions/edit_distance.html +32 -32
 - data/vendor/local/share/doc/groonga/en/html/reference/functions/geo_distance.html +50 -50
 - data/vendor/local/share/doc/groonga/en/html/reference/functions/geo_in_circle.html +32 -32
 - data/vendor/local/share/doc/groonga/en/html/reference/functions/geo_in_rectangle.html +32 -32
 - data/vendor/local/share/doc/groonga/en/html/reference/functions/html_untag.html +34 -34
 - data/vendor/local/share/doc/groonga/en/html/reference/functions/now.html +30 -30
 - data/vendor/local/share/doc/groonga/en/html/reference/functions/query.html +46 -46
 - data/vendor/local/share/doc/groonga/en/html/reference/functions/rand.html +32 -32
 - data/vendor/local/share/doc/groonga/en/html/reference/functions/snippet_html.html +32 -32
 - data/vendor/local/share/doc/groonga/en/html/reference/functions/sub_filter.html +36 -36
 - data/vendor/local/share/doc/groonga/en/html/reference/grn_expr/query_syntax.html +62 -62
 - data/vendor/local/share/doc/groonga/en/html/reference/grn_expr/script_syntax.html +140 -140
 - data/vendor/local/share/doc/groonga/en/html/reference/grn_expr.html +22 -22
 - data/vendor/local/share/doc/groonga/en/html/reference/indexing.html +24 -24
 - data/vendor/local/share/doc/groonga/en/html/reference/log.html +26 -26
 - data/vendor/local/share/doc/groonga/en/html/reference/normalizers.html +31 -31
 - data/vendor/local/share/doc/groonga/en/html/reference/output.html +8 -8
 - data/vendor/local/share/doc/groonga/en/html/reference/pseudo_column.html +22 -22
 - data/vendor/local/share/doc/groonga/en/html/reference/query_expanders/tsv.html +36 -36
 - data/vendor/local/share/doc/groonga/en/html/reference/query_expanders.html +18 -18
 - data/vendor/local/share/doc/groonga/en/html/reference/tables.html +13 -13
 - data/vendor/local/share/doc/groonga/en/html/reference/tokenizers.html +17 -17
 - data/vendor/local/share/doc/groonga/en/html/reference/tuning.html +38 -38
 - data/vendor/local/share/doc/groonga/en/html/reference/types.html +8 -8
 - data/vendor/local/share/doc/groonga/en/html/reference.html +69 -68
 - data/vendor/local/share/doc/groonga/en/html/search.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/searchindex.js +1 -1
 - data/vendor/local/share/doc/groonga/en/html/server/gqtp.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/server/http/comparison.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/server/http/groonga-httpd.html +9 -9
 - data/vendor/local/share/doc/groonga/en/html/server/http/groonga.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/server/http.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/server/package.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/server.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/spec/gqtp.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/spec/search.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/spec.html +9 -9
 - data/vendor/local/share/doc/groonga/en/html/suggest/completion.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/suggest/correction.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/suggest/introduction.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/suggest/suggestion.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/suggest/tutorial.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/suggest.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/troubleshooting/different_results_with_the_same_keyword.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/troubleshooting/mmap_cannot_allocate_memory.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/troubleshooting.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/tutorial/data.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/tutorial/drilldown.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/tutorial/index.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/tutorial/introduction.html +8 -8
 - data/vendor/local/share/doc/groonga/en/html/tutorial/lexicon.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/tutorial/match_columns.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/tutorial/micro_blog.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/tutorial/network.html +12 -12
 - data/vendor/local/share/doc/groonga/en/html/tutorial/patricia_trie.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/tutorial/query_expansion.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/tutorial/search.html +5 -5
 - data/vendor/local/share/doc/groonga/en/html/tutorial.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/.buildinfo +1 -1
 - data/vendor/local/share/doc/groonga/ja/html/_sources/install/centos.txt +3 -3
 - data/vendor/local/share/doc/groonga/ja/html/_sources/install/debian.txt +3 -3
 - data/vendor/local/share/doc/groonga/ja/html/_sources/install/fedora.txt +3 -3
 - data/vendor/local/share/doc/groonga/ja/html/_sources/install/mac_os_x.txt +3 -3
 - data/vendor/local/share/doc/groonga/ja/html/_sources/install/others.txt +3 -3
 - data/vendor/local/share/doc/groonga/ja/html/_sources/install/solaris.txt +3 -3
 - data/vendor/local/share/doc/groonga/ja/html/_sources/install/ubuntu.txt +3 -3
 - data/vendor/local/share/doc/groonga/ja/html/_sources/install/windows.txt +9 -9
 - data/vendor/local/share/doc/groonga/ja/html/_sources/news.txt +41 -0
 - data/vendor/local/share/doc/groonga/ja/html/_sources/reference/column.txt +25 -0
 - data/vendor/local/share/doc/groonga/ja/html/_sources/reference/columns/vector.txt +333 -0
 - data/vendor/local/share/doc/groonga/ja/html/_sources/reference/commands/cache_limit.txt +1 -1
 - data/vendor/local/share/doc/groonga/ja/html/_sources/reference/commands/column_create.txt +1 -2
 - data/vendor/local/share/doc/groonga/ja/html/_sources/reference/commands/column_rename.txt +37 -17
 - data/vendor/local/share/doc/groonga/ja/html/_sources/reference/commands/delete.txt +4 -5
 - data/vendor/local/share/doc/groonga/ja/html/_sources/reference/commands/normalize.txt +1 -2
 - data/vendor/local/share/doc/groonga/ja/html/_sources/reference/commands/select.txt +99 -0
 - data/vendor/local/share/doc/groonga/ja/html/_sources/reference/commands/table_create.txt +1 -1
 - data/vendor/local/share/doc/groonga/ja/html/_sources/reference/commands/truncate.txt +1 -2
 - data/vendor/local/share/doc/groonga/ja/html/_sources/reference/executables/groonga-suggest-httpd.txt +128 -4
 - data/vendor/local/share/doc/groonga/ja/html/_sources/reference/executables/groonga-suggest-learner.txt +11 -1
 - data/vendor/local/share/doc/groonga/ja/html/_sources/reference.txt +3 -2
 - data/vendor/local/share/doc/groonga/ja/html/_static/basic.css +1 -1
 - data/vendor/local/share/doc/groonga/ja/html/_static/doctools.js +1 -1
 - data/vendor/local/share/doc/groonga/ja/html/_static/searchtools.js +1 -1
 - data/vendor/local/share/doc/groonga/ja/html/_static/websupport.js +1 -1
 - data/vendor/local/share/doc/groonga/ja/html/characteristic.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/community.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/contribution/development/com.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/contribution/development/cooperation.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/contribution/development/document.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/contribution/development/query.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/contribution/development/release.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/contribution/development/repository.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/contribution/development/test.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/contribution/development.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/contribution/documentation/c-api.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/contribution/documentation/i18n.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/contribution/documentation.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/contribution/report.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/contribution.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/development/travis-ci.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/development.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/genindex.html +11 -11
 - data/vendor/local/share/doc/groonga/ja/html/geolocation_search.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/index.html +67 -66
 - data/vendor/local/share/doc/groonga/ja/html/install/centos.html +8 -8
 - data/vendor/local/share/doc/groonga/ja/html/install/debian.html +8 -8
 - data/vendor/local/share/doc/groonga/ja/html/install/fedora.html +8 -8
 - data/vendor/local/share/doc/groonga/ja/html/install/mac_os_x.html +8 -8
 - data/vendor/local/share/doc/groonga/ja/html/install/others.html +8 -8
 - data/vendor/local/share/doc/groonga/ja/html/install/solaris.html +8 -8
 - data/vendor/local/share/doc/groonga/ja/html/install/ubuntu.html +8 -8
 - data/vendor/local/share/doc/groonga/ja/html/install/windows.html +14 -14
 - data/vendor/local/share/doc/groonga/ja/html/install.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/limitations.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/news/0.x.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/news/1.0.x.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/news/1.1.x.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/news/1.2.x.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/news/senna.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/news.html +262 -200
 - data/vendor/local/share/doc/groonga/ja/html/objects.inv +0 -0
 - data/vendor/local/share/doc/groonga/ja/html/reference/api/global_configurations.html +22 -22
 - data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_cache.html +24 -24
 - data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_column.html +24 -24
 - data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_command_version.html +24 -24
 - data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_ctx.html +24 -24
 - data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_db.html +24 -24
 - data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_encoding.html +24 -24
 - data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_expr.html +22 -22
 - data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_geo.html +24 -24
 - data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_hook.html +24 -24
 - data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_ii.html +24 -24
 - data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_index_cursor.html +24 -24
 - data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_info.html +24 -24
 - data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_match_escalation.html +24 -24
 - data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_obj.html +24 -24
 - data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_proc.html +24 -24
 - data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_search.html +24 -24
 - data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_table.html +24 -24
 - data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_table_cursor.html +24 -24
 - data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_type.html +24 -24
 - data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_user_data.html +20 -20
 - data/vendor/local/share/doc/groonga/ja/html/reference/api.html +35 -35
 - data/vendor/local/share/doc/groonga/ja/html/reference/cast.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/reference/column.html +150 -0
 - data/vendor/local/share/doc/groonga/ja/html/reference/columns/vector.html +824 -0
 - data/vendor/local/share/doc/groonga/ja/html/reference/command/command_version.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/reference/command/output_format.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/reference/command/return_code.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/reference/command.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/reference/commands/cache_limit.html +6 -6
 - data/vendor/local/share/doc/groonga/ja/html/reference/commands/check.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/reference/commands/clearlock.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/reference/commands/column_create.html +6 -6
 - data/vendor/local/share/doc/groonga/ja/html/reference/commands/column_list.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/reference/commands/column_remove.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/reference/commands/column_rename.html +45 -24
 - data/vendor/local/share/doc/groonga/ja/html/reference/commands/define_selector.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/reference/commands/defrag.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/reference/commands/delete.html +6 -6
 - data/vendor/local/share/doc/groonga/ja/html/reference/commands/dump.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/reference/commands/load.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/reference/commands/log_level.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/reference/commands/log_put.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/reference/commands/log_reopen.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/reference/commands/normalize.html +8 -7
 - data/vendor/local/share/doc/groonga/ja/html/reference/commands/quit.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/reference/commands/register.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/reference/commands/ruby_eval.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/reference/commands/ruby_load.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/reference/commands/select.html +174 -5
 - data/vendor/local/share/doc/groonga/ja/html/reference/commands/shutdown.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/reference/commands/status.html +10 -10
 - data/vendor/local/share/doc/groonga/ja/html/reference/commands/suggest.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/reference/commands/table_create.html +6 -6
 - data/vendor/local/share/doc/groonga/ja/html/reference/commands/table_list.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/reference/commands/table_remove.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/reference/commands/tokenize.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/reference/commands/truncate.html +6 -6
 - data/vendor/local/share/doc/groonga/ja/html/reference/executables/grnslap.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-benchmark.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-httpd.html +8 -8
 - data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-server-http.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-suggest-create-dataset.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-suggest-httpd.html +167 -11
 - data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-suggest-learner.html +23 -6
 - data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/reference/executables.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/reference/function.html +25 -25
 - data/vendor/local/share/doc/groonga/ja/html/reference/functions/between.html +38 -38
 - data/vendor/local/share/doc/groonga/ja/html/reference/functions/edit_distance.html +30 -30
 - data/vendor/local/share/doc/groonga/ja/html/reference/functions/geo_distance.html +48 -48
 - data/vendor/local/share/doc/groonga/ja/html/reference/functions/geo_in_circle.html +30 -30
 - data/vendor/local/share/doc/groonga/ja/html/reference/functions/geo_in_rectangle.html +30 -30
 - data/vendor/local/share/doc/groonga/ja/html/reference/functions/html_untag.html +32 -32
 - data/vendor/local/share/doc/groonga/ja/html/reference/functions/now.html +28 -28
 - data/vendor/local/share/doc/groonga/ja/html/reference/functions/query.html +44 -44
 - data/vendor/local/share/doc/groonga/ja/html/reference/functions/rand.html +30 -30
 - data/vendor/local/share/doc/groonga/ja/html/reference/functions/snippet_html.html +30 -30
 - data/vendor/local/share/doc/groonga/ja/html/reference/functions/sub_filter.html +34 -34
 - data/vendor/local/share/doc/groonga/ja/html/reference/grn_expr/query_syntax.html +60 -60
 - data/vendor/local/share/doc/groonga/ja/html/reference/grn_expr/script_syntax.html +138 -138
 - data/vendor/local/share/doc/groonga/ja/html/reference/grn_expr.html +19 -19
 - data/vendor/local/share/doc/groonga/ja/html/reference/indexing.html +21 -21
 - data/vendor/local/share/doc/groonga/ja/html/reference/log.html +23 -23
 - data/vendor/local/share/doc/groonga/ja/html/reference/normalizers.html +28 -28
 - data/vendor/local/share/doc/groonga/ja/html/reference/output.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/reference/pseudo_column.html +19 -19
 - data/vendor/local/share/doc/groonga/ja/html/reference/query_expanders/tsv.html +34 -34
 - data/vendor/local/share/doc/groonga/ja/html/reference/query_expanders.html +15 -15
 - data/vendor/local/share/doc/groonga/ja/html/reference/tables.html +10 -10
 - data/vendor/local/share/doc/groonga/ja/html/reference/tokenizers.html +14 -14
 - data/vendor/local/share/doc/groonga/ja/html/reference/tuning.html +35 -35
 - data/vendor/local/share/doc/groonga/ja/html/reference/types.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/reference.html +69 -68
 - data/vendor/local/share/doc/groonga/ja/html/search.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/searchindex.js +1 -1
 - data/vendor/local/share/doc/groonga/ja/html/server/gqtp.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/server/http/comparison.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/server/http/groonga-httpd.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/server/http/groonga.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/server/http.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/server/package.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/server.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/spec/gqtp.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/spec/search.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/spec.html +9 -9
 - data/vendor/local/share/doc/groonga/ja/html/suggest/completion.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/suggest/correction.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/suggest/introduction.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/suggest/suggestion.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/suggest/tutorial.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/suggest.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/troubleshooting/different_results_with_the_same_keyword.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/troubleshooting/mmap_cannot_allocate_memory.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/troubleshooting.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/tutorial/data.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/tutorial/drilldown.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/tutorial/index.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/tutorial/introduction.html +8 -8
 - data/vendor/local/share/doc/groonga/ja/html/tutorial/lexicon.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/tutorial/match_columns.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/tutorial/micro_blog.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/tutorial/network.html +12 -12
 - data/vendor/local/share/doc/groonga/ja/html/tutorial/patricia_trie.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/tutorial/query_expansion.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/tutorial/search.html +5 -5
 - data/vendor/local/share/doc/groonga/ja/html/tutorial.html +5 -5
 - data/vendor/local/share/man/ja/man1/groonga.1 +526 -73
 - data/vendor/local/share/man/man1/groonga.1 +552 -80
 - metadata +148 -139
 
| 
         @@ -1,6 +1,6 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            /* -*- coding: utf-8; mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
         
     | 
| 
       2 
2 
     | 
    
         
             
            /*
         
     | 
| 
       3 
     | 
    
         
            -
              Copyright (C) 2009- 
     | 
| 
      
 3 
     | 
    
         
            +
              Copyright (C) 2009-2014  Kouhei Sutou <kou@clear-code.com>
         
     | 
| 
       4 
4 
     | 
    
         | 
| 
       5 
5 
     | 
    
         
             
              This library is free software; you can redistribute it and/or
         
     | 
| 
       6 
6 
     | 
    
         
             
              modify it under the terms of the GNU Lesser General Public
         
     | 
| 
         @@ -18,16 +18,411 @@ 
     | 
|
| 
       18 
18 
     | 
    
         | 
| 
       19 
19 
     | 
    
         
             
            #include "rb-grn.h"
         
     | 
| 
       20 
20 
     | 
    
         | 
| 
       21 
     | 
    
         
            -
            #define SELF(object) (( 
     | 
| 
      
 21 
     | 
    
         
            +
            #define SELF(object) ((RbGrnVariableSizeColumn *)DATA_PTR(object))
         
     | 
| 
       22 
22 
     | 
    
         | 
| 
       23 
23 
     | 
    
         
             
            VALUE rb_cGrnVariableSizeColumn;
         
     | 
| 
       24 
24 
     | 
    
         | 
| 
      
 25 
     | 
    
         
            +
            void
         
     | 
| 
      
 26 
     | 
    
         
            +
            rb_grn_variable_size_column_bind (RbGrnVariableSizeColumn *rb_column,
         
     | 
| 
      
 27 
     | 
    
         
            +
                                              grn_ctx *context, grn_obj *column)
         
     | 
| 
      
 28 
     | 
    
         
            +
            {
         
     | 
| 
      
 29 
     | 
    
         
            +
                RbGrnObject *rb_grn_object;
         
     | 
| 
      
 30 
     | 
    
         
            +
                int column_type;
         
     | 
| 
      
 31 
     | 
    
         
            +
                unsigned char value_type;
         
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
      
 33 
     | 
    
         
            +
                rb_grn_object = RB_GRN_OBJECT(rb_column);
         
     | 
| 
      
 34 
     | 
    
         
            +
                rb_grn_column_bind(RB_GRN_COLUMN(rb_column), context, column);
         
     | 
| 
      
 35 
     | 
    
         
            +
             
     | 
| 
      
 36 
     | 
    
         
            +
                rb_column->element_value = NULL;
         
     | 
| 
      
 37 
     | 
    
         
            +
                column_type = (column->header.flags & GRN_OBJ_COLUMN_TYPE_MASK);
         
     | 
| 
      
 38 
     | 
    
         
            +
                if (column_type != GRN_OBJ_COLUMN_VECTOR) {
         
     | 
| 
      
 39 
     | 
    
         
            +
                    return;
         
     | 
| 
      
 40 
     | 
    
         
            +
                }
         
     | 
| 
      
 41 
     | 
    
         
            +
             
     | 
| 
      
 42 
     | 
    
         
            +
                switch (rb_grn_object->range->header.type) {
         
     | 
| 
      
 43 
     | 
    
         
            +
                case GRN_TABLE_HASH_KEY:
         
     | 
| 
      
 44 
     | 
    
         
            +
                case GRN_TABLE_PAT_KEY:
         
     | 
| 
      
 45 
     | 
    
         
            +
                case GRN_TABLE_DAT_KEY:
         
     | 
| 
      
 46 
     | 
    
         
            +
                case GRN_TABLE_NO_KEY:
         
     | 
| 
      
 47 
     | 
    
         
            +
                    value_type = GRN_UVECTOR;
         
     | 
| 
      
 48 
     | 
    
         
            +
                    break;
         
     | 
| 
      
 49 
     | 
    
         
            +
                default:
         
     | 
| 
      
 50 
     | 
    
         
            +
                    value_type = GRN_VECTOR;
         
     | 
| 
      
 51 
     | 
    
         
            +
                    break;
         
     | 
| 
      
 52 
     | 
    
         
            +
                }
         
     | 
| 
      
 53 
     | 
    
         
            +
                if (column->header.flags & GRN_OBJ_WITH_WEIGHT) {
         
     | 
| 
      
 54 
     | 
    
         
            +
                    rb_column->element_value = grn_obj_open(context, value_type, 0,
         
     | 
| 
      
 55 
     | 
    
         
            +
                                                            rb_grn_object->range_id);
         
     | 
| 
      
 56 
     | 
    
         
            +
                }
         
     | 
| 
      
 57 
     | 
    
         
            +
            }
         
     | 
| 
      
 58 
     | 
    
         
            +
             
     | 
| 
      
 59 
     | 
    
         
            +
            void
         
     | 
| 
      
 60 
     | 
    
         
            +
            rb_grn_variable_size_column_finalizer (grn_ctx *context, grn_obj *grn_object,
         
     | 
| 
      
 61 
     | 
    
         
            +
                                                   RbGrnVariableSizeColumn *rb_column)
         
     | 
| 
      
 62 
     | 
    
         
            +
            {
         
     | 
| 
      
 63 
     | 
    
         
            +
                rb_grn_column_finalizer(context, grn_object,
         
     | 
| 
      
 64 
     | 
    
         
            +
                                        RB_GRN_COLUMN(rb_column));
         
     | 
| 
      
 65 
     | 
    
         
            +
                if (context && rb_column->element_value)
         
     | 
| 
      
 66 
     | 
    
         
            +
                    grn_obj_unlink(context, rb_column->element_value);
         
     | 
| 
      
 67 
     | 
    
         
            +
                rb_column->element_value = NULL;
         
     | 
| 
      
 68 
     | 
    
         
            +
            }
         
     | 
| 
      
 69 
     | 
    
         
            +
             
     | 
| 
      
 70 
     | 
    
         
            +
            static void
         
     | 
| 
      
 71 
     | 
    
         
            +
            rb_grn_variable_size_column_deconstruct (RbGrnVariableSizeColumn *rb_column,
         
     | 
| 
      
 72 
     | 
    
         
            +
                                                     grn_obj **column,
         
     | 
| 
      
 73 
     | 
    
         
            +
                                                     grn_ctx **context,
         
     | 
| 
      
 74 
     | 
    
         
            +
                                                     grn_id *domain_id,
         
     | 
| 
      
 75 
     | 
    
         
            +
                                                     grn_obj **domain,
         
     | 
| 
      
 76 
     | 
    
         
            +
                                                     grn_obj **value,
         
     | 
| 
      
 77 
     | 
    
         
            +
                                                     grn_obj **element_value,
         
     | 
| 
      
 78 
     | 
    
         
            +
                                                     grn_id *range_id,
         
     | 
| 
      
 79 
     | 
    
         
            +
                                                     grn_obj **range)
         
     | 
| 
      
 80 
     | 
    
         
            +
            {
         
     | 
| 
      
 81 
     | 
    
         
            +
                RbGrnColumn *rb_grn_column;
         
     | 
| 
      
 82 
     | 
    
         
            +
             
     | 
| 
      
 83 
     | 
    
         
            +
                rb_grn_column = RB_GRN_COLUMN(rb_column);
         
     | 
| 
      
 84 
     | 
    
         
            +
                rb_grn_column_deconstruct(rb_grn_column, column, context,
         
     | 
| 
      
 85 
     | 
    
         
            +
                                          domain_id, domain, value,
         
     | 
| 
      
 86 
     | 
    
         
            +
                                          range_id, range);
         
     | 
| 
      
 87 
     | 
    
         
            +
             
     | 
| 
      
 88 
     | 
    
         
            +
                if (element_value)
         
     | 
| 
      
 89 
     | 
    
         
            +
                    *element_value = rb_column->element_value;
         
     | 
| 
      
 90 
     | 
    
         
            +
            }
         
     | 
| 
      
 91 
     | 
    
         
            +
             
     | 
| 
       25 
92 
     | 
    
         
             
            /*
         
     | 
| 
       26 
93 
     | 
    
         
             
             * Document-class: Groonga::VariableSizeColumn < Groonga::Column
         
     | 
| 
       27 
94 
     | 
    
         
             
             *
         
     | 
| 
       28 
     | 
    
         
            -
             *  
     | 
| 
      
 95 
     | 
    
         
            +
             * A column for variable size data like text family types and vector
         
     | 
| 
      
 96 
     | 
    
         
            +
             * column.
         
     | 
| 
       29 
97 
     | 
    
         
             
             */
         
     | 
| 
       30 
98 
     | 
    
         | 
| 
      
 99 
     | 
    
         
            +
            /*
         
     | 
| 
      
 100 
     | 
    
         
            +
             * It gets a value of variable size column value for the record that
         
     | 
| 
      
 101 
     | 
    
         
            +
             * ID is _id_.
         
     | 
| 
      
 102 
     | 
    
         
            +
             *
         
     | 
| 
      
 103 
     | 
    
         
            +
             * @example Gets weight vector value
         
     | 
| 
      
 104 
     | 
    
         
            +
             *    Groonga::Schema.define do |schema|
         
     | 
| 
      
 105 
     | 
    
         
            +
             *      schema.create_table("Products",
         
     | 
| 
      
 106 
     | 
    
         
            +
             *                          :type => :patricia_trie,
         
     | 
| 
      
 107 
     | 
    
         
            +
             *                          :key_type => "ShortText") do |table|
         
     | 
| 
      
 108 
     | 
    
         
            +
             *        # This is weight vector.
         
     | 
| 
      
 109 
     | 
    
         
            +
             *        # ":with_weight => true" is important to store weight value.
         
     | 
| 
      
 110 
     | 
    
         
            +
             *        table.short_text("tags",
         
     | 
| 
      
 111 
     | 
    
         
            +
             *                         :type => :vector,
         
     | 
| 
      
 112 
     | 
    
         
            +
             *                         :with_weight => true)
         
     | 
| 
      
 113 
     | 
    
         
            +
             *      end
         
     | 
| 
      
 114 
     | 
    
         
            +
             *    end
         
     | 
| 
      
 115 
     | 
    
         
            +
             *
         
     | 
| 
      
 116 
     | 
    
         
            +
             *    products = Groonga["Products"]
         
     | 
| 
      
 117 
     | 
    
         
            +
             *    rroonga = products.add("Rroonga")
         
     | 
| 
      
 118 
     | 
    
         
            +
             *    rroonga.tags = [
         
     | 
| 
      
 119 
     | 
    
         
            +
             *      {
         
     | 
| 
      
 120 
     | 
    
         
            +
             *        :value  => "ruby",
         
     | 
| 
      
 121 
     | 
    
         
            +
             *        :weight => 100,
         
     | 
| 
      
 122 
     | 
    
         
            +
             *      },
         
     | 
| 
      
 123 
     | 
    
         
            +
             *      {
         
     | 
| 
      
 124 
     | 
    
         
            +
             *        :value  => "groonga",
         
     | 
| 
      
 125 
     | 
    
         
            +
             *        :weight => 10,
         
     | 
| 
      
 126 
     | 
    
         
            +
             *      },
         
     | 
| 
      
 127 
     | 
    
         
            +
             *    ]
         
     | 
| 
      
 128 
     | 
    
         
            +
             *
         
     | 
| 
      
 129 
     | 
    
         
            +
             *    p rroonga.tags
         
     | 
| 
      
 130 
     | 
    
         
            +
             *    # => [
         
     | 
| 
      
 131 
     | 
    
         
            +
             *    #      {:value => "ruby",    :weight => 100},
         
     | 
| 
      
 132 
     | 
    
         
            +
             *    #      {:value => "groonga", :weight => 10}
         
     | 
| 
      
 133 
     | 
    
         
            +
             *    #    ]
         
     | 
| 
      
 134 
     | 
    
         
            +
             *
         
     | 
| 
      
 135 
     | 
    
         
            +
             * @overload [](id)
         
     | 
| 
      
 136 
     | 
    
         
            +
             *   @param [Integer, Record] id The record ID.
         
     | 
| 
      
 137 
     | 
    
         
            +
             *   @return [Array<Hash<Symbol, String>>] An array of value if the column
         
     | 
| 
      
 138 
     | 
    
         
            +
             *     is a weight vector column.
         
     | 
| 
      
 139 
     | 
    
         
            +
             *     Each value is a Hash like the following form:
         
     | 
| 
      
 140 
     | 
    
         
            +
             *
         
     | 
| 
      
 141 
     | 
    
         
            +
             *     <pre>
         
     | 
| 
      
 142 
     | 
    
         
            +
             *     {
         
     | 
| 
      
 143 
     | 
    
         
            +
             *       :value  => [KEY],
         
     | 
| 
      
 144 
     | 
    
         
            +
             *       :weight => [WEIGHT],
         
     | 
| 
      
 145 
     | 
    
         
            +
             *     }
         
     | 
| 
      
 146 
     | 
    
         
            +
             *     </pre>
         
     | 
| 
      
 147 
     | 
    
         
            +
             *
         
     | 
| 
      
 148 
     | 
    
         
            +
             *     @[KEY]@ is the key of the table that is specified as range on
         
     | 
| 
      
 149 
     | 
    
         
            +
             *     creating the weight vector.
         
     | 
| 
      
 150 
     | 
    
         
            +
             *
         
     | 
| 
      
 151 
     | 
    
         
            +
             *     @[WEIGHT]@ is a positive integer.
         
     | 
| 
      
 152 
     | 
    
         
            +
             *
         
     | 
| 
      
 153 
     | 
    
         
            +
             *   @return [::Object] See {Groonga::Object#[]} for columns except
         
     | 
| 
      
 154 
     | 
    
         
            +
             *     weight vector column.
         
     | 
| 
      
 155 
     | 
    
         
            +
             *
         
     | 
| 
      
 156 
     | 
    
         
            +
             * @since 4.0.1.
         
     | 
| 
      
 157 
     | 
    
         
            +
             */
         
     | 
| 
      
 158 
     | 
    
         
            +
            static VALUE
         
     | 
| 
      
 159 
     | 
    
         
            +
            rb_grn_variable_size_column_array_reference (VALUE self, VALUE rb_id)
         
     | 
| 
      
 160 
     | 
    
         
            +
            {
         
     | 
| 
      
 161 
     | 
    
         
            +
                grn_ctx *context = NULL;
         
     | 
| 
      
 162 
     | 
    
         
            +
                grn_obj *column, *range;
         
     | 
| 
      
 163 
     | 
    
         
            +
                grn_id id;
         
     | 
| 
      
 164 
     | 
    
         
            +
                grn_obj *value;
         
     | 
| 
      
 165 
     | 
    
         
            +
                VALUE rb_value;
         
     | 
| 
      
 166 
     | 
    
         
            +
                unsigned int i, n;
         
     | 
| 
      
 167 
     | 
    
         
            +
             
     | 
| 
      
 168 
     | 
    
         
            +
                rb_grn_variable_size_column_deconstruct(SELF(self), &column, &context,
         
     | 
| 
      
 169 
     | 
    
         
            +
                                                        NULL, NULL, &value, NULL,
         
     | 
| 
      
 170 
     | 
    
         
            +
                                                        NULL, &range);
         
     | 
| 
      
 171 
     | 
    
         
            +
             
     | 
| 
      
 172 
     | 
    
         
            +
                if (!(column->header.flags & GRN_OBJ_WITH_WEIGHT)) {
         
     | 
| 
      
 173 
     | 
    
         
            +
                    return rb_call_super(1, &rb_id);
         
     | 
| 
      
 174 
     | 
    
         
            +
                }
         
     | 
| 
      
 175 
     | 
    
         
            +
             
     | 
| 
      
 176 
     | 
    
         
            +
                id = RVAL2GRNID(rb_id, context, range, self);
         
     | 
| 
      
 177 
     | 
    
         
            +
             
     | 
| 
      
 178 
     | 
    
         
            +
                grn_obj_reinit(context, value,
         
     | 
| 
      
 179 
     | 
    
         
            +
                               value->header.domain,
         
     | 
| 
      
 180 
     | 
    
         
            +
                               value->header.flags | GRN_OBJ_VECTOR);
         
     | 
| 
      
 181 
     | 
    
         
            +
                grn_obj_get_value(context, column, id, value);
         
     | 
| 
      
 182 
     | 
    
         
            +
                rb_grn_context_check(context, self);
         
     | 
| 
      
 183 
     | 
    
         
            +
             
     | 
| 
      
 184 
     | 
    
         
            +
                n = grn_vector_size(context, value);
         
     | 
| 
      
 185 
     | 
    
         
            +
                rb_value = rb_ary_new2(n);
         
     | 
| 
      
 186 
     | 
    
         
            +
                for (i = 0; i < n; i++) {
         
     | 
| 
      
 187 
     | 
    
         
            +
                    const char *element_value;
         
     | 
| 
      
 188 
     | 
    
         
            +
                    unsigned int element_value_length;
         
     | 
| 
      
 189 
     | 
    
         
            +
                    unsigned int weight = 0;
         
     | 
| 
      
 190 
     | 
    
         
            +
                    grn_id domain;
         
     | 
| 
      
 191 
     | 
    
         
            +
                    VALUE rb_element;
         
     | 
| 
      
 192 
     | 
    
         
            +
             
     | 
| 
      
 193 
     | 
    
         
            +
                    element_value_length = grn_vector_get_element(context,
         
     | 
| 
      
 194 
     | 
    
         
            +
                                                                  value,
         
     | 
| 
      
 195 
     | 
    
         
            +
                                                                  i,
         
     | 
| 
      
 196 
     | 
    
         
            +
                                                                  &element_value,
         
     | 
| 
      
 197 
     | 
    
         
            +
                                                                  &weight,
         
     | 
| 
      
 198 
     | 
    
         
            +
                                                                  &domain);
         
     | 
| 
      
 199 
     | 
    
         
            +
                    rb_element = rb_hash_new();
         
     | 
| 
      
 200 
     | 
    
         
            +
                    rb_hash_aset(rb_element,
         
     | 
| 
      
 201 
     | 
    
         
            +
                                 ID2SYM(rb_intern("value")),
         
     | 
| 
      
 202 
     | 
    
         
            +
                                 rb_str_new(element_value, element_value_length));
         
     | 
| 
      
 203 
     | 
    
         
            +
                    rb_hash_aset(rb_element,
         
     | 
| 
      
 204 
     | 
    
         
            +
                                 ID2SYM(rb_intern("weight")),
         
     | 
| 
      
 205 
     | 
    
         
            +
                                 UINT2NUM(weight));
         
     | 
| 
      
 206 
     | 
    
         
            +
             
     | 
| 
      
 207 
     | 
    
         
            +
                    rb_ary_push(rb_value, rb_element);
         
     | 
| 
      
 208 
     | 
    
         
            +
                }
         
     | 
| 
      
 209 
     | 
    
         
            +
             
     | 
| 
      
 210 
     | 
    
         
            +
                return rb_value;
         
     | 
| 
      
 211 
     | 
    
         
            +
            }
         
     | 
| 
      
 212 
     | 
    
         
            +
             
     | 
| 
      
 213 
     | 
    
         
            +
            typedef struct {
         
     | 
| 
      
 214 
     | 
    
         
            +
                grn_ctx *context;
         
     | 
| 
      
 215 
     | 
    
         
            +
                grn_obj *vector;
         
     | 
| 
      
 216 
     | 
    
         
            +
                grn_obj *element_value;
         
     | 
| 
      
 217 
     | 
    
         
            +
            } HashElementToVectorElementData;
         
     | 
| 
      
 218 
     | 
    
         
            +
             
     | 
| 
      
 219 
     | 
    
         
            +
            static int
         
     | 
| 
      
 220 
     | 
    
         
            +
            hash_element_to_vector_element(VALUE key, VALUE value, VALUE user_data)
         
     | 
| 
      
 221 
     | 
    
         
            +
            {
         
     | 
| 
      
 222 
     | 
    
         
            +
                HashElementToVectorElementData *data =
         
     | 
| 
      
 223 
     | 
    
         
            +
                    (HashElementToVectorElementData *)user_data;
         
     | 
| 
      
 224 
     | 
    
         
            +
                unsigned int weight;
         
     | 
| 
      
 225 
     | 
    
         
            +
             
     | 
| 
      
 226 
     | 
    
         
            +
                GRN_BULK_REWIND(data->element_value);
         
     | 
| 
      
 227 
     | 
    
         
            +
                RVAL2GRNBULK(key, data->context, data->element_value);
         
     | 
| 
      
 228 
     | 
    
         
            +
             
     | 
| 
      
 229 
     | 
    
         
            +
                weight = NUM2UINT(value);
         
     | 
| 
      
 230 
     | 
    
         
            +
                grn_vector_add_element(data->context, data->vector,
         
     | 
| 
      
 231 
     | 
    
         
            +
                                       GRN_BULK_HEAD(data->element_value),
         
     | 
| 
      
 232 
     | 
    
         
            +
                                       GRN_BULK_VSIZE(data->element_value),
         
     | 
| 
      
 233 
     | 
    
         
            +
                                       weight,
         
     | 
| 
      
 234 
     | 
    
         
            +
                                       data->element_value->header.domain);
         
     | 
| 
      
 235 
     | 
    
         
            +
             
     | 
| 
      
 236 
     | 
    
         
            +
                return ST_CONTINUE;
         
     | 
| 
      
 237 
     | 
    
         
            +
            }
         
     | 
| 
      
 238 
     | 
    
         
            +
             
     | 
| 
      
 239 
     | 
    
         
            +
            /*
         
     | 
| 
      
 240 
     | 
    
         
            +
             * It updates a value of variable size column value for the record
         
     | 
| 
      
 241 
     | 
    
         
            +
             * that ID is _id_.
         
     | 
| 
      
 242 
     | 
    
         
            +
             *
         
     | 
| 
      
 243 
     | 
    
         
            +
             * Weight vector column is a special variable size column. This
         
     | 
| 
      
 244 
     | 
    
         
            +
             * description describes only weight vector column. Other variable
         
     | 
| 
      
 245 
     | 
    
         
            +
             * size column works what you think.
         
     | 
| 
      
 246 
     | 
    
         
            +
             *
         
     | 
| 
      
 247 
     | 
    
         
            +
             * @example Use weight vector as matrix search result weight
         
     | 
| 
      
 248 
     | 
    
         
            +
             *    Groonga::Schema.define do |schema|
         
     | 
| 
      
 249 
     | 
    
         
            +
             *      schema.create_table("Products",
         
     | 
| 
      
 250 
     | 
    
         
            +
             *                          :type => :patricia_trie,
         
     | 
| 
      
 251 
     | 
    
         
            +
             *                          :key_type => "ShortText") do |table|
         
     | 
| 
      
 252 
     | 
    
         
            +
             *        # This is weight vector.
         
     | 
| 
      
 253 
     | 
    
         
            +
             *        # ":with_weight => true" is important for matrix search result weight.
         
     | 
| 
      
 254 
     | 
    
         
            +
             *        table.short_text("tags",
         
     | 
| 
      
 255 
     | 
    
         
            +
             *                         :type => :vector,
         
     | 
| 
      
 256 
     | 
    
         
            +
             *                         :with_weight => true)
         
     | 
| 
      
 257 
     | 
    
         
            +
             *      end
         
     | 
| 
      
 258 
     | 
    
         
            +
             *
         
     | 
| 
      
 259 
     | 
    
         
            +
             *      schema.create_table("Tags",
         
     | 
| 
      
 260 
     | 
    
         
            +
             *                          :type => :hash,
         
     | 
| 
      
 261 
     | 
    
         
            +
             *                          :key_type => "ShortText") do |table|
         
     | 
| 
      
 262 
     | 
    
         
            +
             *        # This is inverted index. It also needs ":with_weight => true".
         
     | 
| 
      
 263 
     | 
    
         
            +
             *        table.index("Products.tags", :with_weight => true)
         
     | 
| 
      
 264 
     | 
    
         
            +
             *      end
         
     | 
| 
      
 265 
     | 
    
         
            +
             *    end
         
     | 
| 
      
 266 
     | 
    
         
            +
             *
         
     | 
| 
      
 267 
     | 
    
         
            +
             *    products = Groonga["Products"]
         
     | 
| 
      
 268 
     | 
    
         
            +
             *    groonga = products.add("Groonga")
         
     | 
| 
      
 269 
     | 
    
         
            +
             *    groonga.tags = [
         
     | 
| 
      
 270 
     | 
    
         
            +
             *      {
         
     | 
| 
      
 271 
     | 
    
         
            +
             *        :value  => "groonga",
         
     | 
| 
      
 272 
     | 
    
         
            +
             *        :weight => 100,
         
     | 
| 
      
 273 
     | 
    
         
            +
             *      },
         
     | 
| 
      
 274 
     | 
    
         
            +
             *    ]
         
     | 
| 
      
 275 
     | 
    
         
            +
             *    rroonga = products.add("Rroonga")
         
     | 
| 
      
 276 
     | 
    
         
            +
             *    rroonga.tags = [
         
     | 
| 
      
 277 
     | 
    
         
            +
             *      {
         
     | 
| 
      
 278 
     | 
    
         
            +
             *        :value  => "ruby",
         
     | 
| 
      
 279 
     | 
    
         
            +
             *        :weight => 100,
         
     | 
| 
      
 280 
     | 
    
         
            +
             *      },
         
     | 
| 
      
 281 
     | 
    
         
            +
             *      {
         
     | 
| 
      
 282 
     | 
    
         
            +
             *        :value  => "groonga",
         
     | 
| 
      
 283 
     | 
    
         
            +
             *        :weight => 10,
         
     | 
| 
      
 284 
     | 
    
         
            +
             *      },
         
     | 
| 
      
 285 
     | 
    
         
            +
             *    ]
         
     | 
| 
      
 286 
     | 
    
         
            +
             *
         
     | 
| 
      
 287 
     | 
    
         
            +
             *    result = products.select do |record|
         
     | 
| 
      
 288 
     | 
    
         
            +
             *      # Search by "groonga"
         
     | 
| 
      
 289 
     | 
    
         
            +
             *      record.match("groonga") do |match_target|
         
     | 
| 
      
 290 
     | 
    
         
            +
             *        match_target.tags
         
     | 
| 
      
 291 
     | 
    
         
            +
             *      end
         
     | 
| 
      
 292 
     | 
    
         
            +
             *    end
         
     | 
| 
      
 293 
     | 
    
         
            +
             *
         
     | 
| 
      
 294 
     | 
    
         
            +
             *    result.each do |record|
         
     | 
| 
      
 295 
     | 
    
         
            +
             *      p [record.key.key, record.score]
         
     | 
| 
      
 296 
     | 
    
         
            +
             *    end
         
     | 
| 
      
 297 
     | 
    
         
            +
             *    # Matches all records with weight.
         
     | 
| 
      
 298 
     | 
    
         
            +
             *    # => ["Groonga", 101]
         
     | 
| 
      
 299 
     | 
    
         
            +
             *    #    ["Rroonga", 11]
         
     | 
| 
      
 300 
     | 
    
         
            +
             *
         
     | 
| 
      
 301 
     | 
    
         
            +
             *    # Increases score for "ruby" 10 times
         
     | 
| 
      
 302 
     | 
    
         
            +
             *    products.select(# The previous search result. Required.
         
     | 
| 
      
 303 
     | 
    
         
            +
             *                    :result => result,
         
     | 
| 
      
 304 
     | 
    
         
            +
             *                    # It just adds score to existing records in the result. Required.
         
     | 
| 
      
 305 
     | 
    
         
            +
             *                    :operator => Groonga::Operator::ADJUST) do |record|
         
     | 
| 
      
 306 
     | 
    
         
            +
             *      record.match("ruby") do |target|
         
     | 
| 
      
 307 
     | 
    
         
            +
             *        target.tags * 10 # 10 times
         
     | 
| 
      
 308 
     | 
    
         
            +
             *      end
         
     | 
| 
      
 309 
     | 
    
         
            +
             *    end
         
     | 
| 
      
 310 
     | 
    
         
            +
             *
         
     | 
| 
      
 311 
     | 
    
         
            +
             *    result.each do |record|
         
     | 
| 
      
 312 
     | 
    
         
            +
             *      p [record.key.key, record.score]
         
     | 
| 
      
 313 
     | 
    
         
            +
             *    end
         
     | 
| 
      
 314 
     | 
    
         
            +
             *    # Weight is used for increasing score.
         
     | 
| 
      
 315 
     | 
    
         
            +
             *    # => ["Groonga", 101]  <- Not changed.
         
     | 
| 
      
 316 
     | 
    
         
            +
             *    #    ["Rroonga", 1021] <- 1021 (= 101 * 10 + 1) increased.
         
     | 
| 
      
 317 
     | 
    
         
            +
             *
         
     | 
| 
      
 318 
     | 
    
         
            +
             * @overload []=(id, elements)
         
     | 
| 
      
 319 
     | 
    
         
            +
             *   This description is for weight vector column.
         
     | 
| 
      
 320 
     | 
    
         
            +
             *
         
     | 
| 
      
 321 
     | 
    
         
            +
             *   @param [Integer, Record] id The record ID.
         
     | 
| 
      
 322 
     | 
    
         
            +
             *   @param [Array<Hash<Symbol, String>>] elements An array of values
         
     | 
| 
      
 323 
     | 
    
         
            +
             *     for weight vector.
         
     | 
| 
      
 324 
     | 
    
         
            +
             *     Each value is a Hash like the following form:
         
     | 
| 
      
 325 
     | 
    
         
            +
             *
         
     | 
| 
      
 326 
     | 
    
         
            +
             *     <pre>
         
     | 
| 
      
 327 
     | 
    
         
            +
             *     {
         
     | 
| 
      
 328 
     | 
    
         
            +
             *       :value  => [KEY],
         
     | 
| 
      
 329 
     | 
    
         
            +
             *       :weight => [WEIGHT],
         
     | 
| 
      
 330 
     | 
    
         
            +
             *     }
         
     | 
| 
      
 331 
     | 
    
         
            +
             *     </pre>
         
     | 
| 
      
 332 
     | 
    
         
            +
             *
         
     | 
| 
      
 333 
     | 
    
         
            +
             *     @[KEY]@ must be the same type of the key of the table that is
         
     | 
| 
      
 334 
     | 
    
         
            +
             *     specified as range on creating the weight vector.
         
     | 
| 
      
 335 
     | 
    
         
            +
             *
         
     | 
| 
      
 336 
     | 
    
         
            +
             *     @[WEIGHT]@ must be an positive integer. Note that search
         
     | 
| 
      
 337 
     | 
    
         
            +
             *     becomes @weight + 1@. It means that You want to get 10 as
         
     | 
| 
      
 338 
     | 
    
         
            +
             *     score, you should set 9 as weight.
         
     | 
| 
      
 339 
     | 
    
         
            +
             *
         
     | 
| 
      
 340 
     | 
    
         
            +
             * @overload []=(id, value)
         
     | 
| 
      
 341 
     | 
    
         
            +
             *   This description is for variable size columns except weight
         
     | 
| 
      
 342 
     | 
    
         
            +
             *   vector column.
         
     | 
| 
      
 343 
     | 
    
         
            +
             *
         
     | 
| 
      
 344 
     | 
    
         
            +
             *   @param [Integer, Record] id The record ID.
         
     | 
| 
      
 345 
     | 
    
         
            +
             *   @param [::Object] value A new value.
         
     | 
| 
      
 346 
     | 
    
         
            +
             *   @see Groonga::Object#[]=
         
     | 
| 
      
 347 
     | 
    
         
            +
             *
         
     | 
| 
      
 348 
     | 
    
         
            +
             * @since 4.0.1
         
     | 
| 
      
 349 
     | 
    
         
            +
             */
         
     | 
| 
      
 350 
     | 
    
         
            +
            static VALUE
         
     | 
| 
      
 351 
     | 
    
         
            +
            rb_grn_variable_size_column_array_set (VALUE self, VALUE rb_id, VALUE rb_value)
         
     | 
| 
      
 352 
     | 
    
         
            +
            {
         
     | 
| 
      
 353 
     | 
    
         
            +
                grn_ctx *context = NULL;
         
     | 
| 
      
 354 
     | 
    
         
            +
                grn_obj *column, *range;
         
     | 
| 
      
 355 
     | 
    
         
            +
                grn_rc rc;
         
     | 
| 
      
 356 
     | 
    
         
            +
                grn_id id;
         
     | 
| 
      
 357 
     | 
    
         
            +
                grn_obj *value, *element_value;
         
     | 
| 
      
 358 
     | 
    
         
            +
                int flags = GRN_OBJ_SET;
         
     | 
| 
      
 359 
     | 
    
         
            +
             
     | 
| 
      
 360 
     | 
    
         
            +
                rb_grn_variable_size_column_deconstruct(SELF(self), &column, &context,
         
     | 
| 
      
 361 
     | 
    
         
            +
                                                        NULL, NULL, &value, &element_value,
         
     | 
| 
      
 362 
     | 
    
         
            +
                                                        NULL, &range);
         
     | 
| 
      
 363 
     | 
    
         
            +
             
     | 
| 
      
 364 
     | 
    
         
            +
                if (!(column->header.flags & GRN_OBJ_WITH_WEIGHT)) {
         
     | 
| 
      
 365 
     | 
    
         
            +
                    VALUE args[2];
         
     | 
| 
      
 366 
     | 
    
         
            +
                    args[0] = rb_id;
         
     | 
| 
      
 367 
     | 
    
         
            +
                    args[1] = rb_value;
         
     | 
| 
      
 368 
     | 
    
         
            +
                    return rb_call_super(2, args);
         
     | 
| 
      
 369 
     | 
    
         
            +
                }
         
     | 
| 
      
 370 
     | 
    
         
            +
             
     | 
| 
      
 371 
     | 
    
         
            +
                id = RVAL2GRNID(rb_id, context, range, self);
         
     | 
| 
      
 372 
     | 
    
         
            +
             
     | 
| 
      
 373 
     | 
    
         
            +
                grn_obj_reinit(context, value,
         
     | 
| 
      
 374 
     | 
    
         
            +
                               value->header.domain,
         
     | 
| 
      
 375 
     | 
    
         
            +
                               value->header.flags | GRN_OBJ_VECTOR);
         
     | 
| 
      
 376 
     | 
    
         
            +
                if (RVAL2CBOOL(rb_obj_is_kind_of(rb_value, rb_cArray))) {
         
     | 
| 
      
 377 
     | 
    
         
            +
                    int i, n;
         
     | 
| 
      
 378 
     | 
    
         
            +
                    n = RARRAY_LEN(rb_value);
         
     | 
| 
      
 379 
     | 
    
         
            +
                    for (i = 0; i < n; i++) {
         
     | 
| 
      
 380 
     | 
    
         
            +
                        unsigned int weight = 0;
         
     | 
| 
      
 381 
     | 
    
         
            +
                        VALUE rb_element_value, rb_weight;
         
     | 
| 
      
 382 
     | 
    
         
            +
             
     | 
| 
      
 383 
     | 
    
         
            +
                        rb_grn_scan_options(RARRAY_PTR(rb_value)[i],
         
     | 
| 
      
 384 
     | 
    
         
            +
                                            "value", &rb_element_value,
         
     | 
| 
      
 385 
     | 
    
         
            +
                                            "weight", &rb_weight,
         
     | 
| 
      
 386 
     | 
    
         
            +
                                            NULL);
         
     | 
| 
      
 387 
     | 
    
         
            +
             
     | 
| 
      
 388 
     | 
    
         
            +
                        if (!NIL_P(rb_weight)) {
         
     | 
| 
      
 389 
     | 
    
         
            +
                            weight = NUM2UINT(rb_weight);
         
     | 
| 
      
 390 
     | 
    
         
            +
                        }
         
     | 
| 
      
 391 
     | 
    
         
            +
             
     | 
| 
      
 392 
     | 
    
         
            +
                        GRN_BULK_REWIND(element_value);
         
     | 
| 
      
 393 
     | 
    
         
            +
                        if (!NIL_P(rb_element_value)) {
         
     | 
| 
      
 394 
     | 
    
         
            +
                            RVAL2GRNBULK(rb_element_value, context, element_value);
         
     | 
| 
      
 395 
     | 
    
         
            +
                        }
         
     | 
| 
      
 396 
     | 
    
         
            +
             
     | 
| 
      
 397 
     | 
    
         
            +
                        grn_vector_add_element(context, value,
         
     | 
| 
      
 398 
     | 
    
         
            +
                                               GRN_BULK_HEAD(element_value),
         
     | 
| 
      
 399 
     | 
    
         
            +
                                               GRN_BULK_VSIZE(element_value),
         
     | 
| 
      
 400 
     | 
    
         
            +
                                               weight,
         
     | 
| 
      
 401 
     | 
    
         
            +
                                               element_value->header.domain);
         
     | 
| 
      
 402 
     | 
    
         
            +
                    }
         
     | 
| 
      
 403 
     | 
    
         
            +
                } else if (RVAL2CBOOL(rb_obj_is_kind_of(rb_value, rb_cHash))) {
         
     | 
| 
      
 404 
     | 
    
         
            +
                    HashElementToVectorElementData data;
         
     | 
| 
      
 405 
     | 
    
         
            +
                    data.context = context;
         
     | 
| 
      
 406 
     | 
    
         
            +
                    data.vector = value;
         
     | 
| 
      
 407 
     | 
    
         
            +
                    data.element_value = element_value;
         
     | 
| 
      
 408 
     | 
    
         
            +
                    rb_hash_foreach(rb_value, hash_element_to_vector_element, (VALUE)&data);
         
     | 
| 
      
 409 
     | 
    
         
            +
                } else {
         
     | 
| 
      
 410 
     | 
    
         
            +
                    rb_raise(rb_eArgError,
         
     | 
| 
      
 411 
     | 
    
         
            +
                             "<%s>: "
         
     | 
| 
      
 412 
     | 
    
         
            +
                             "weight vector value must be an array of index value or "
         
     | 
| 
      
 413 
     | 
    
         
            +
                             "a hash that key is vector value and value is vector weight: "
         
     | 
| 
      
 414 
     | 
    
         
            +
                             "<%s>",
         
     | 
| 
      
 415 
     | 
    
         
            +
                             rb_grn_inspect(self),
         
     | 
| 
      
 416 
     | 
    
         
            +
                             rb_grn_inspect(rb_value));
         
     | 
| 
      
 417 
     | 
    
         
            +
                }
         
     | 
| 
      
 418 
     | 
    
         
            +
             
     | 
| 
      
 419 
     | 
    
         
            +
                rc = grn_obj_set_value(context, column, id, value, flags);
         
     | 
| 
      
 420 
     | 
    
         
            +
                rb_grn_context_check(context, self);
         
     | 
| 
      
 421 
     | 
    
         
            +
                rb_grn_rc_check(rc, self);
         
     | 
| 
      
 422 
     | 
    
         
            +
             
     | 
| 
      
 423 
     | 
    
         
            +
                return rb_value;
         
     | 
| 
      
 424 
     | 
    
         
            +
            }
         
     | 
| 
      
 425 
     | 
    
         
            +
             
     | 
| 
       31 
426 
     | 
    
         
             
            /*
         
     | 
| 
       32 
427 
     | 
    
         
             
             * Returns whether the column is compressed or not. If
         
     | 
| 
       33 
428 
     | 
    
         
             
             * @type@ is specified, it returns whether the column is
         
     | 
| 
         @@ -42,7 +437,7 @@ VALUE rb_cGrnVariableSizeColumn; 
     | 
|
| 
       42 
437 
     | 
    
         
             
            static VALUE
         
     | 
| 
       43 
438 
     | 
    
         
             
            rb_grn_variable_size_column_compressed_p (int argc, VALUE *argv, VALUE self)
         
     | 
| 
       44 
439 
     | 
    
         
             
            {
         
     | 
| 
       45 
     | 
    
         
            -
                 
     | 
| 
      
 440 
     | 
    
         
            +
                RbGrnVariableSizeColumn *rb_grn_column;
         
     | 
| 
       46 
441 
     | 
    
         
             
                grn_ctx *context = NULL;
         
     | 
| 
       47 
442 
     | 
    
         
             
                grn_obj *column;
         
     | 
| 
       48 
443 
     | 
    
         
             
                grn_obj_flags flags;
         
     | 
| 
         @@ -112,7 +507,7 @@ rb_grn_variable_size_column_compressed_p (int argc, VALUE *argv, VALUE self) 
     | 
|
| 
       112 
507 
     | 
    
         
             
            static VALUE
         
     | 
| 
       113 
508 
     | 
    
         
             
            rb_grn_variable_size_column_defrag (int argc, VALUE *argv, VALUE self)
         
     | 
| 
       114 
509 
     | 
    
         
             
            {
         
     | 
| 
       115 
     | 
    
         
            -
                 
     | 
| 
      
 510 
     | 
    
         
            +
                RbGrnVariableSizeColumn *rb_grn_column;
         
     | 
| 
       116 
511 
     | 
    
         
             
                grn_ctx *context = NULL;
         
     | 
| 
       117 
512 
     | 
    
         
             
                grn_obj *column;
         
     | 
| 
       118 
513 
     | 
    
         
             
                int n_segments;
         
     | 
| 
         @@ -143,6 +538,11 @@ rb_grn_init_variable_size_column (VALUE mGrn) 
     | 
|
| 
       143 
538 
     | 
    
         
             
                rb_cGrnVariableSizeColumn =
         
     | 
| 
       144 
539 
     | 
    
         
             
                    rb_define_class_under(mGrn, "VariableSizeColumn", rb_cGrnColumn);
         
     | 
| 
       145 
540 
     | 
    
         | 
| 
      
 541 
     | 
    
         
            +
                rb_define_method(rb_cGrnVariableSizeColumn, "[]",
         
     | 
| 
      
 542 
     | 
    
         
            +
                                 rb_grn_variable_size_column_array_reference, 1);
         
     | 
| 
      
 543 
     | 
    
         
            +
                rb_define_method(rb_cGrnVariableSizeColumn, "[]=",
         
     | 
| 
      
 544 
     | 
    
         
            +
                                 rb_grn_variable_size_column_array_set, 2);
         
     | 
| 
      
 545 
     | 
    
         
            +
             
     | 
| 
       146 
546 
     | 
    
         
             
                rb_define_method(rb_cGrnVariableSizeColumn, "compressed?",
         
     | 
| 
       147 
547 
     | 
    
         
             
                                 rb_grn_variable_size_column_compressed_p, -1);
         
     | 
| 
       148 
548 
     | 
    
         
             
                rb_define_method(rb_cGrnVariableSizeColumn, "defrag",
         
     | 
    
        data/ext/groonga/rb-grn.h
    CHANGED
    
    | 
         @@ -84,7 +84,7 @@ RB_GRN_BEGIN_DECLS 
     | 
|
| 
       84 
84 
     | 
    
         | 
| 
       85 
85 
     | 
    
         
             
            #define RB_GRN_MAJOR_VERSION 4
         
     | 
| 
       86 
86 
     | 
    
         
             
            #define RB_GRN_MINOR_VERSION 0
         
     | 
| 
       87 
     | 
    
         
            -
            #define RB_GRN_MICRO_VERSION  
     | 
| 
      
 87 
     | 
    
         
            +
            #define RB_GRN_MICRO_VERSION 1
         
     | 
| 
       88 
88 
     | 
    
         | 
| 
       89 
89 
     | 
    
         
             
            #define RB_GRN_QUERY_DEFAULT_MAX_EXPRESSIONS 32
         
     | 
| 
       90 
90 
     | 
    
         | 
| 
         @@ -96,6 +96,7 @@ RB_GRN_BEGIN_DECLS 
     | 
|
| 
       96 
96 
     | 
    
         
             
            #define RB_GRN_TABLE_KEY_SUPPORT(object) ((RbGrnTableKeySupport *)(object))
         
     | 
| 
       97 
97 
     | 
    
         
             
            #define RB_GRN_TABLE_CURSOR(object) ((RbGrnTableCursort *)(object))
         
     | 
| 
       98 
98 
     | 
    
         
             
            #define RB_GRN_COLUMN(object) ((RbGrnColumn *)(object))
         
     | 
| 
      
 99 
     | 
    
         
            +
            #define RB_GRN_VARIABLE_SIZE_COLUMN(object) ((RbGrnVariableSizeColumn *)(object))
         
     | 
| 
       99 
100 
     | 
    
         
             
            #define RB_GRN_INDEX_COLUMN(object) ((RbGrnIndexColumn *)(object))
         
     | 
| 
       100 
101 
     | 
    
         
             
            #define RB_GRN_ACCESSOR(object) ((RbGrnAccessor *)(object))
         
     | 
| 
       101 
102 
     | 
    
         
             
            #define RB_GRN_EXPRESSION(object) ((RbGrnExpression *)(object))
         
     | 
| 
         @@ -159,11 +160,19 @@ struct _RbGrnColumn 
     | 
|
| 
       159 
160 
     | 
    
         
             
                grn_obj *value;
         
     | 
| 
       160 
161 
     | 
    
         
             
            };
         
     | 
| 
       161 
162 
     | 
    
         | 
| 
      
 163 
     | 
    
         
            +
            typedef struct _RbGrnVariableSizeColumn RbGrnVariableSizeColumn;
         
     | 
| 
      
 164 
     | 
    
         
            +
            struct _RbGrnVariableSizeColumn
         
     | 
| 
      
 165 
     | 
    
         
            +
            {
         
     | 
| 
      
 166 
     | 
    
         
            +
                RbGrnColumn parent;
         
     | 
| 
      
 167 
     | 
    
         
            +
                grn_obj *element_value;
         
     | 
| 
      
 168 
     | 
    
         
            +
            };
         
     | 
| 
      
 169 
     | 
    
         
            +
             
     | 
| 
       162 
170 
     | 
    
         
             
            typedef struct _RbGrnIndexColumn RbGrnIndexColumn;
         
     | 
| 
       163 
171 
     | 
    
         
             
            struct _RbGrnIndexColumn
         
     | 
| 
       164 
172 
     | 
    
         
             
            {
         
     | 
| 
       165 
173 
     | 
    
         
             
                RbGrnColumn parent;
         
     | 
| 
       166 
174 
     | 
    
         
             
                grn_obj *old_value;
         
     | 
| 
      
 175 
     | 
    
         
            +
                grn_obj *set_value;
         
     | 
| 
       167 
176 
     | 
    
         
             
                grn_obj *id_query;
         
     | 
| 
       168 
177 
     | 
    
         
             
                grn_obj *string_query;
         
     | 
| 
       169 
178 
     | 
    
         
             
            };
         
     | 
| 
         @@ -490,6 +499,13 @@ void           rb_grn_column_deconstruct            (RbGrnColumn *rb_grn_column, 
     | 
|
| 
       490 
499 
     | 
    
         
             
                                                                 grn_id *range_id,
         
     | 
| 
       491 
500 
     | 
    
         
             
                                                                 grn_obj **range);
         
     | 
| 
       492 
501 
     | 
    
         | 
| 
      
 502 
     | 
    
         
            +
            void           rb_grn_variable_size_column_bind     (RbGrnVariableSizeColumn *rb_grn_column,
         
     | 
| 
      
 503 
     | 
    
         
            +
                                                                 grn_ctx *context,
         
     | 
| 
      
 504 
     | 
    
         
            +
                                                                 grn_obj *column);
         
     | 
| 
      
 505 
     | 
    
         
            +
            void           rb_grn_variable_size_column_finalizer(grn_ctx *context,
         
     | 
| 
      
 506 
     | 
    
         
            +
                                                                 grn_obj *column,
         
     | 
| 
      
 507 
     | 
    
         
            +
                                                                 RbGrnVariableSizeColumn *rb_grn_column);
         
     | 
| 
      
 508 
     | 
    
         
            +
             
     | 
| 
       493 
509 
     | 
    
         
             
            void           rb_grn_index_column_bind             (RbGrnIndexColumn *rb_grn_index_column,
         
     | 
| 
       494 
510 
     | 
    
         
             
                                                                 grn_ctx *context,
         
     | 
| 
       495 
511 
     | 
    
         
             
                                                                 grn_obj *object);
         
     | 
| 
         @@ -503,6 +519,7 @@ void           rb_grn_index_column_deconstruct      (RbGrnIndexColumn *rb_grn_in 
     | 
|
| 
       503 
519 
     | 
    
         
             
                                                                 grn_obj **domain,
         
     | 
| 
       504 
520 
     | 
    
         
             
                                                                 grn_obj **value,
         
     | 
| 
       505 
521 
     | 
    
         
             
                                                                 grn_obj **old_value,
         
     | 
| 
      
 522 
     | 
    
         
            +
                                                                 grn_obj **set_value,
         
     | 
| 
       506 
523 
     | 
    
         
             
                                                                 grn_id *range_id,
         
     | 
| 
       507 
524 
     | 
    
         
             
                                                                 grn_obj **range,
         
     | 
| 
       508 
525 
     | 
    
         
             
                                                                 grn_obj **id_query,
         
     | 
    
        data/lib/1.9/groonga.so
    CHANGED
    
    | 
         Binary file 
     | 
    
        data/lib/2.0/groonga.so
    CHANGED
    
    | 
         Binary file 
     | 
    
        data/lib/2.1/groonga.so
    CHANGED
    
    | 
         Binary file 
     | 
    
        data/lib/groonga/dumper.rb
    CHANGED
    
    | 
         @@ -395,10 +395,6 @@ module Groonga 
     | 
|
| 
       395 
395 
     | 
    
         
             
                    return nil if normalizer.nil?
         
     | 
| 
       396 
396 
     | 
    
         
             
                    normalizer.name
         
     | 
| 
       397 
397 
     | 
    
         
             
                  end
         
     | 
| 
       398 
     | 
    
         
            -
             
     | 
| 
       399 
     | 
    
         
            -
                  def default_normalizer?(normalizer_name)
         
     | 
| 
       400 
     | 
    
         
            -
                    normalizer_name == "NormalizerAuto"
         
     | 
| 
       401 
     | 
    
         
            -
                  end
         
     | 
| 
       402 
398 
     | 
    
         
             
                end
         
     | 
| 
       403 
399 
     | 
    
         | 
| 
       404 
400 
     | 
    
         
             
                # @private
         
     | 
| 
         @@ -418,15 +414,12 @@ module Groonga 
     | 
|
| 
       418 
414 
     | 
    
         
             
                      end
         
     | 
| 
       419 
415 
     | 
    
         
             
                      if table.domain
         
     | 
| 
       420 
416 
     | 
    
         
             
                        parameters << ":key_type => #{table.domain.name.dump}"
         
     | 
| 
       421 
     | 
    
         
            -
                        if default_normalizer?(_normalizer_name)
         
     | 
| 
       422 
     | 
    
         
            -
                          parameters << ":key_normalize => true"
         
     | 
| 
       423 
     | 
    
         
            -
                        end
         
     | 
| 
       424 
417 
     | 
    
         
             
                      end
         
     | 
| 
       425 
418 
     | 
    
         
             
                      default_tokenizer = table.default_tokenizer
         
     | 
| 
       426 
419 
     | 
    
         
             
                      if default_tokenizer
         
     | 
| 
       427 
420 
     | 
    
         
             
                        parameters << ":default_tokenizer => #{default_tokenizer.name.dump}"
         
     | 
| 
       428 
421 
     | 
    
         
             
                      end
         
     | 
| 
       429 
     | 
    
         
            -
                      if _normalizer_name 
     | 
| 
      
 422 
     | 
    
         
            +
                      if _normalizer_name
         
     | 
| 
       430 
423 
     | 
    
         
             
                        parameters << ":normalizer => #{_normalizer_name.dump}"
         
     | 
| 
       431 
424 
     | 
    
         
             
                      end
         
     | 
| 
       432 
425 
     | 
    
         
             
                    end
         
     | 
| 
         @@ -460,9 +453,11 @@ module Groonga 
     | 
|
| 
       460 
453 
     | 
    
         
             
                    name = column.local_name
         
     | 
| 
       461 
454 
     | 
    
         
             
                    reference = column.range
         
     | 
| 
       462 
455 
     | 
    
         
             
                    options = column_options(column)
         
     | 
| 
       463 
     | 
    
         
            -
                    arguments = [ 
     | 
| 
       464 
     | 
    
         
            -
             
     | 
| 
       465 
     | 
    
         
            -
             
     | 
| 
      
 456 
     | 
    
         
            +
                    arguments = [
         
     | 
| 
      
 457 
     | 
    
         
            +
                      dump_object(name),
         
     | 
| 
      
 458 
     | 
    
         
            +
                      dump_object(reference.name),
         
     | 
| 
      
 459 
     | 
    
         
            +
                      options,
         
     | 
| 
      
 460 
     | 
    
         
            +
                    ].compact.join(", ")
         
     | 
| 
       466 
461 
     | 
    
         
             
                    write("  table.reference(#{arguments})\n")
         
     | 
| 
       467 
462 
     | 
    
         
             
                  end
         
     | 
| 
       468 
463 
     | 
    
         | 
| 
         @@ -477,9 +472,17 @@ module Groonga 
     | 
|
| 
       477 
472 
     | 
    
         
             
                      end
         
     | 
| 
       478 
473 
     | 
    
         
             
                      dump_object(name)
         
     | 
| 
       479 
474 
     | 
    
         
             
                    end.join(", ")
         
     | 
| 
       480 
     | 
    
         
            -
                     
     | 
| 
       481 
     | 
    
         
            -
             
     | 
| 
       482 
     | 
    
         
            -
             
     | 
| 
      
 475 
     | 
    
         
            +
                    options = {
         
     | 
| 
      
 476 
     | 
    
         
            +
                      :name => column.local_name,
         
     | 
| 
      
 477 
     | 
    
         
            +
                    }
         
     | 
| 
      
 478 
     | 
    
         
            +
                    options[:with_section]  = true if column.with_section?
         
     | 
| 
      
 479 
     | 
    
         
            +
                    options[:with_weight]   = true if column.with_weight?
         
     | 
| 
      
 480 
     | 
    
         
            +
                    options[:with_position] = true if column.with_position?
         
     | 
| 
      
 481 
     | 
    
         
            +
                    arguments = [
         
     | 
| 
      
 482 
     | 
    
         
            +
                      dump_object(target_table_name),
         
     | 
| 
      
 483 
     | 
    
         
            +
                      sources.size == 1 ? source_names : "[#{source_names}]",
         
     | 
| 
      
 484 
     | 
    
         
            +
                      dump_options(options),
         
     | 
| 
      
 485 
     | 
    
         
            +
                    ]
         
     | 
| 
       483 
486 
     | 
    
         
             
                    write("  table.index(#{arguments.join(', ')})\n")
         
     | 
| 
       484 
487 
     | 
    
         
             
                  end
         
     | 
| 
       485 
488 
     | 
    
         | 
| 
         @@ -514,15 +517,19 @@ module Groonga 
     | 
|
| 
       514 
517 
     | 
    
         
             
                  def column_options(column)
         
     | 
| 
       515 
518 
     | 
    
         
             
                    options = {}
         
     | 
| 
       516 
519 
     | 
    
         
             
                    options[:type] = :vector if column.vector?
         
     | 
| 
      
 520 
     | 
    
         
            +
                    options[:with_weight] = true if column.with_weight?
         
     | 
| 
       517 
521 
     | 
    
         
             
                    return nil if options.empty?
         
     | 
| 
       518 
522 
     | 
    
         | 
| 
       519 
     | 
    
         
            -
                     
     | 
| 
       520 
     | 
    
         
            -
             
     | 
| 
      
 523 
     | 
    
         
            +
                    dump_options(options)
         
     | 
| 
      
 524 
     | 
    
         
            +
                  end
         
     | 
| 
      
 525 
     | 
    
         
            +
             
     | 
| 
      
 526 
     | 
    
         
            +
                  def dump_options(options)
         
     | 
| 
      
 527 
     | 
    
         
            +
                    dumped_options = options.collect do |key, value|
         
     | 
| 
       521 
528 
     | 
    
         
             
                      dumped_key = dump_object(key)
         
     | 
| 
       522 
529 
     | 
    
         
             
                      dumped_value = dump_object(value)
         
     | 
| 
       523 
     | 
    
         
            -
                       
     | 
| 
      
 530 
     | 
    
         
            +
                      "#{dumped_key} => #{dumped_value}"
         
     | 
| 
       524 
531 
     | 
    
         
             
                    end
         
     | 
| 
       525 
     | 
    
         
            -
                    dumped_options
         
     | 
| 
      
 532 
     | 
    
         
            +
                    dumped_options.join(", ")
         
     | 
| 
       526 
533 
     | 
    
         
             
                  end
         
     | 
| 
       527 
534 
     | 
    
         | 
| 
       528 
535 
     | 
    
         
             
                  def dump_object(object)
         
     | 
| 
         @@ -552,7 +559,6 @@ module Groonga 
     | 
|
| 
       552 
559 
     | 
    
         
             
                      flags << "TABLE_DAT_KEY"
         
     | 
| 
       553 
560 
     | 
    
         
             
                    end
         
     | 
| 
       554 
561 
     | 
    
         
             
                    if table.domain
         
     | 
| 
       555 
     | 
    
         
            -
                      flags << "KEY_NORMALIZE" if default_normalizer?(_normalizer_name)
         
     | 
| 
       556 
562 
     | 
    
         
             
                      if table.is_a?(Groonga::PatriciaTrie) and table.register_key_with_sis?
         
     | 
| 
       557 
563 
     | 
    
         
             
                        flags << "KEY_WITH_SIS"
         
     | 
| 
       558 
564 
     | 
    
         
             
                      end
         
     | 
| 
         @@ -570,7 +576,7 @@ module Groonga 
     | 
|
| 
       570 
576 
     | 
    
         
             
                        parameters << "--default_tokenizer #{default_tokenizer.name}"
         
     | 
| 
       571 
577 
     | 
    
         
             
                      end
         
     | 
| 
       572 
578 
     | 
    
         
             
                    end
         
     | 
| 
       573 
     | 
    
         
            -
                    if _normalizer_name 
     | 
| 
      
 579 
     | 
    
         
            +
                    if _normalizer_name
         
     | 
| 
       574 
580 
     | 
    
         
             
                      parameters << "--normalizer #{_normalizer_name}"
         
     | 
| 
       575 
581 
     | 
    
         
             
                    end
         
     | 
| 
       576 
582 
     | 
    
         
             
                    write("table_create #{table.name} #{parameters.join(' ')}\n")
         
     | 
| 
         @@ -595,6 +601,7 @@ module Groonga 
     | 
|
| 
       595 
601 
     | 
    
         
             
                    elsif column.vector?
         
     | 
| 
       596 
602 
     | 
    
         
             
                      flags << "COLUMN_VECTOR"
         
     | 
| 
       597 
603 
     | 
    
         
             
                    end
         
     | 
| 
      
 604 
     | 
    
         
            +
                    flags << "WITH_WEIGHT" if column.with_weight?
         
     | 
| 
       598 
605 
     | 
    
         
             
                    # TODO: support COMPRESS_ZLIB and COMPRESS_LZO?
         
     | 
| 
       599 
606 
     | 
    
         
             
                    parameters << "#{flags.join('|')}"
         
     | 
| 
       600 
607 
     | 
    
         
             
                    parameters << "#{column.range.name}"
         
     | 
| 
         @@ -687,8 +694,12 @@ module Groonga 
     | 
|
| 
       687 
694 
     | 
    
         
             
                def resolve_value(record, column, value)
         
     | 
| 
       688 
695 
     | 
    
         
             
                  case value
         
     | 
| 
       689 
696 
     | 
    
         
             
                  when ::Array
         
     | 
| 
       690 
     | 
    
         
            -
                     
     | 
| 
       691 
     | 
    
         
            -
                       
     | 
| 
      
 697 
     | 
    
         
            +
                    if column.vector? and column.with_weight?
         
     | 
| 
      
 698 
     | 
    
         
            +
                      resolve_weight_vector_value(record, column, value)
         
     | 
| 
      
 699 
     | 
    
         
            +
                    else
         
     | 
| 
      
 700 
     | 
    
         
            +
                      value.collect do |v|
         
     | 
| 
      
 701 
     | 
    
         
            +
                        resolve_value(record, column, v)
         
     | 
| 
      
 702 
     | 
    
         
            +
                      end
         
     | 
| 
       692 
703 
     | 
    
         
             
                    end
         
     | 
| 
       693 
704 
     | 
    
         
             
                  when Groonga::Record
         
     | 
| 
       694 
705 
     | 
    
         
             
                    if value.support_key?
         
     | 
| 
         @@ -726,6 +737,19 @@ module Groonga 
     | 
|
| 
       726 
737 
     | 
    
         
             
                  end
         
     | 
| 
       727 
738 
     | 
    
         
             
                end
         
     | 
| 
       728 
739 
     | 
    
         | 
| 
      
 740 
     | 
    
         
            +
                def resolve_weight_vector_value(record, column, entries)
         
     | 
| 
      
 741 
     | 
    
         
            +
                  resolved_weight_vector_entries = {}
         
     | 
| 
      
 742 
     | 
    
         
            +
                  sorted_entries = entries.sort_by do |entry|
         
     | 
| 
      
 743 
     | 
    
         
            +
                    entry[:value]
         
     | 
| 
      
 744 
     | 
    
         
            +
                  end
         
     | 
| 
      
 745 
     | 
    
         
            +
                  sorted_entries.each do |entry|
         
     | 
| 
      
 746 
     | 
    
         
            +
                    resolved_value = resolve_value(record, column, entry[:value])
         
     | 
| 
      
 747 
     | 
    
         
            +
                    resolved_weight = resolve_value(record, column, entry[:weight])
         
     | 
| 
      
 748 
     | 
    
         
            +
                    resolved_weight_vector_entries[resolved_value] = resolved_weight
         
     | 
| 
      
 749 
     | 
    
         
            +
                  end
         
     | 
| 
      
 750 
     | 
    
         
            +
                  resolved_weight_vector_entries
         
     | 
| 
      
 751 
     | 
    
         
            +
                end
         
     | 
| 
      
 752 
     | 
    
         
            +
             
     | 
| 
       729 
753 
     | 
    
         
             
                def fix_encoding(value)
         
     | 
| 
       730 
754 
     | 
    
         
             
                  if value.encoding == ::Encoding::ASCII_8BIT
         
     | 
| 
       731 
755 
     | 
    
         
             
                    value.force_encoding(@table.context.ruby_encoding)
         
     | 
| 
         @@ -79,10 +79,8 @@ module Groonga 
     | 
|
| 
       79 
79 
     | 
    
         
             
                    end
         
     | 
| 
       80 
80 
     | 
    
         
             
                  end
         
     | 
| 
       81 
81 
     | 
    
         | 
| 
       82 
     | 
    
         
            -
                  if builders.empty? 
     | 
| 
       83 
     | 
    
         
            -
                    expression.append_constant( 
     | 
| 
       84 
     | 
    
         
            -
                    expression.append_constant(1)
         
     | 
| 
       85 
     | 
    
         
            -
                    expression.append_operation(Groonga::Operation::OR, 2)
         
     | 
| 
      
 82 
     | 
    
         
            +
                  if builders.empty?
         
     | 
| 
      
 83 
     | 
    
         
            +
                    expression.append_constant(true)
         
     | 
| 
       86 
84 
     | 
    
         
             
                  else
         
     | 
| 
       87 
85 
     | 
    
         
             
                    combined_builder = builders.inject(nil) do |previous, builder|
         
     | 
| 
       88 
86 
     | 
    
         
             
                      if previous.nil?
         
     |