rroonga 3.0.2-x86-mingw32 → 3.0.4-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.
- data/doc/text/news.textile +30 -1
- data/ext/groonga/extconf.rb +49 -26
- data/ext/groonga/rb-grn-array.c +56 -1
- data/ext/groonga/rb-grn-column.c +1 -1
- data/ext/groonga/rb-grn-double-array-trie.c +1 -1
- data/ext/groonga/rb-grn-exception.c +3 -3
- data/ext/groonga/rb-grn-expression.c +14 -9
- data/ext/groonga/rb-grn-index-column.c +1 -1
- data/ext/groonga/rb-grn-operator.c +10 -3
- data/ext/groonga/rb-grn-patricia-trie.c +1 -1
- data/ext/groonga/rb-grn-table.c +71 -25
- data/ext/groonga/rb-grn-utils.c +3 -1
- data/ext/groonga/rb-grn-variable.c +17 -4
- data/ext/groonga/rb-grn.h +2 -1
- data/lib/1.9/groonga.so +0 -0
- data/lib/2.0/groonga.so +0 -0
- data/lib/groonga/record.rb +9 -2
- data/lib/groonga/sub-records.rb +62 -0
- data/rroonga-build.rb +2 -1
- data/rroonga.gemspec +1 -1
- data/test/test-array.rb +35 -0
- data/test/test-context.rb +2 -1
- data/test/test-database.rb +2 -1
- data/test/test-expression.rb +14 -4
- data/test/test-sub-records.rb +109 -0
- data/test/test-table.rb +104 -0
- 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 +20 -2
- 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/contribution/development/release.txt +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 +43 -0
- data/vendor/local/share/doc/groonga/en/html/_sources/reference/commands/tokenize.txt +2 -2
- data/vendor/local/share/doc/groonga/en/html/_sources/reference/functions/html_untag.txt +75 -0
- data/vendor/local/share/doc/groonga/en/html/_sources/reference/functions/query.txt +14 -6
- data/vendor/local/share/doc/groonga/en/html/_sources/reference/functions/sub_filter.txt +28 -17
- data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/data.txt +5 -0
- data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/micro_blog.txt +19 -0
- data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/network.txt +5 -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.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/development/com.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 +6 -6
- 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/documentation.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/report.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/development.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/genindex.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/geolocation_search.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/index.html +11 -10
- data/vendor/local/share/doc/groonga/en/html/install.html +5 -5
- 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/limitations.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/news.html +187 -137
- 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/objects.inv +0 -0
- data/vendor/local/share/doc/groonga/en/html/reference.html +11 -10
- data/vendor/local/share/doc/groonga/en/html/reference/api.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_ctx.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/api/grn_expr.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/cast.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/command.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/command/command_version.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/command/output_format.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/command/return_code.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/cache_limit.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/check.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/clearlock.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/column_create.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/column_list.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/column_remove.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/column_rename.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/define_selector.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/defrag.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/delete.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/dump.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/load.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/log_level.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/log_put.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/log_reopen.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/normalize.html +16 -6
- data/vendor/local/share/doc/groonga/en/html/reference/commands/quit.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/register.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/select.html +6 -6
- data/vendor/local/share/doc/groonga/en/html/reference/commands/shutdown.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/status.html +10 -10
- data/vendor/local/share/doc/groonga/en/html/reference/commands/suggest.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/table_create.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/table_list.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/table_remove.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands/tokenize.html +514 -7
- data/vendor/local/share/doc/groonga/en/html/reference/commands/truncate.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands_not_implemented/add.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands_not_implemented/get.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/commands_not_implemented/set.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/executables.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/executables/grnslap.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/executables/grntest.html +6 -6
- data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-httpd.html +8 -8
- data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-server-http.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-suggest-create-dataset.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/function.html +11 -10
- data/vendor/local/share/doc/groonga/en/html/reference/functions/edit_distance.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/functions/geo_distance.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/functions/geo_in_circle.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/functions/geo_in_rectangle.html +10 -10
- data/vendor/local/share/doc/groonga/en/html/reference/functions/html_untag.html +231 -0
- data/vendor/local/share/doc/groonga/en/html/reference/functions/now.html +26 -26
- data/vendor/local/share/doc/groonga/en/html/reference/functions/query.html +55 -49
- data/vendor/local/share/doc/groonga/en/html/reference/functions/rand.html +27 -27
- data/vendor/local/share/doc/groonga/en/html/reference/functions/snippet_html.html +27 -27
- data/vendor/local/share/doc/groonga/en/html/reference/functions/sub_filter.html +53 -44
- data/vendor/local/share/doc/groonga/en/html/reference/grn_expr.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/grn_expr/query_syntax.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/grn_expr/script_syntax.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/indexing.html +9 -9
- data/vendor/local/share/doc/groonga/en/html/reference/log.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/normalizers.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/output.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/pseudo_column.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/query_expanders.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/query_expanders/tsv.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/tables.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/tokenizers.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference/types.html +5 -5
- 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.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/server/gqtp.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/http/comparison.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/server/http/groonga-httpd.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/server/http/groonga.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/server/package.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/spec.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/suggest.html +5 -5
- 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/troubleshooting.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/tutorial.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/tutorial/data.html +10 -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 +29 -11
- data/vendor/local/share/doc/groonga/en/html/tutorial/network.html +17 -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/ja/html/.buildinfo +1 -1
- data/vendor/local/share/doc/groonga/ja/html/_sources/contribution/development/release.txt +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 +43 -0
- data/vendor/local/share/doc/groonga/ja/html/_sources/reference/commands/tokenize.txt +2 -2
- data/vendor/local/share/doc/groonga/ja/html/_sources/reference/functions/html_untag.txt +75 -0
- data/vendor/local/share/doc/groonga/ja/html/_sources/reference/functions/query.txt +14 -6
- data/vendor/local/share/doc/groonga/ja/html/_sources/reference/functions/sub_filter.txt +28 -17
- data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/data.txt +5 -0
- data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/micro_blog.txt +19 -0
- data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/network.txt +5 -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.html +11 -8
- data/vendor/local/share/doc/groonga/ja/html/contribution/development.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/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 +6 -6
- 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/documentation.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 +25 -15
- data/vendor/local/share/doc/groonga/ja/html/contribution/report.html +9 -7
- data/vendor/local/share/doc/groonga/ja/html/development.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/development/travis-ci.html +21 -13
- data/vendor/local/share/doc/groonga/ja/html/genindex.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/geolocation_search.html +23 -14
- data/vendor/local/share/doc/groonga/ja/html/index.html +11 -10
- data/vendor/local/share/doc/groonga/ja/html/install.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/install/centos.html +14 -11
- data/vendor/local/share/doc/groonga/ja/html/install/debian.html +14 -11
- data/vendor/local/share/doc/groonga/ja/html/install/fedora.html +14 -11
- 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 +38 -23
- data/vendor/local/share/doc/groonga/ja/html/install/solaris.html +8 -8
- data/vendor/local/share/doc/groonga/ja/html/install/ubuntu.html +14 -11
- data/vendor/local/share/doc/groonga/ja/html/install/windows.html +14 -14
- data/vendor/local/share/doc/groonga/ja/html/limitations.html +15 -10
- data/vendor/local/share/doc/groonga/ja/html/news.html +885 -481
- 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 +280 -146
- data/vendor/local/share/doc/groonga/ja/html/news/senna.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/objects.inv +0 -0
- data/vendor/local/share/doc/groonga/ja/html/reference.html +11 -10
- data/vendor/local/share/doc/groonga/ja/html/reference/api.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_ctx.html +17 -11
- data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_expr.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/cast.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/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 +9 -7
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/cache_limit.html +5 -5
- 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 +5 -5
- 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 +9 -7
- 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 +5 -5
- 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 +17 -11
- 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 +20 -8
- 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/select.html +12 -9
- 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 +33 -19
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/table_create.html +43 -24
- 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 +558 -75
- data/vendor/local/share/doc/groonga/ja/html/reference/commands/truncate.html +9 -7
- data/vendor/local/share/doc/groonga/ja/html/reference/commands_not_implemented/add.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands_not_implemented/get.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/commands_not_implemented/set.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/executables/grnslap.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/executables/grntest.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-httpd.html +10 -9
- 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.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/function.html +11 -10
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/edit_distance.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/geo_distance.html +11 -8
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/geo_in_circle.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/geo_in_rectangle.html +10 -10
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/html_untag.html +231 -0
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/now.html +26 -26
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/query.html +55 -50
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/rand.html +27 -27
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/snippet_html.html +39 -33
- data/vendor/local/share/doc/groonga/ja/html/reference/functions/sub_filter.html +53 -44
- data/vendor/local/share/doc/groonga/ja/html/reference/grn_expr.html +15 -11
- data/vendor/local/share/doc/groonga/ja/html/reference/grn_expr/query_syntax.html +23 -14
- data/vendor/local/share/doc/groonga/ja/html/reference/grn_expr/script_syntax.html +13 -9
- data/vendor/local/share/doc/groonga/ja/html/reference/indexing.html +9 -9
- data/vendor/local/share/doc/groonga/ja/html/reference/log.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/normalizers.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/output.html +11 -8
- data/vendor/local/share/doc/groonga/ja/html/reference/pseudo_column.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/query_expanders.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/query_expanders/tsv.html +15 -10
- data/vendor/local/share/doc/groonga/ja/html/reference/tables.html +41 -23
- data/vendor/local/share/doc/groonga/ja/html/reference/tokenizers.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference/types.html +5 -5
- 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.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/server/gqtp.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/http/comparison.html +83 -46
- 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/package.html +41 -23
- data/vendor/local/share/doc/groonga/ja/html/spec.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/spec/gqtp.html +71 -38
- data/vendor/local/share/doc/groonga/ja/html/spec/search.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/suggest.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/suggest/completion.html +55 -30
- data/vendor/local/share/doc/groonga/ja/html/suggest/correction.html +33 -19
- data/vendor/local/share/doc/groonga/ja/html/suggest/introduction.html +19 -12
- data/vendor/local/share/doc/groonga/ja/html/suggest/suggestion.html +27 -16
- data/vendor/local/share/doc/groonga/ja/html/suggest/tutorial.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/troubleshooting.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/tutorial.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/tutorial/data.html +17 -11
- 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 +24 -16
- 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 +31 -11
- data/vendor/local/share/doc/groonga/ja/html/tutorial/network.html +16 -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/man/ja/man1/groonga.1 +847 -160
- data/vendor/local/share/man/man1/groonga.1 +826 -97
- metadata +10 -2
data/ext/groonga/rb-grn-utils.c
CHANGED
@@ -1147,7 +1147,9 @@ rb_grn_obj_to_ruby_object (VALUE klass, grn_ctx *context,
|
|
1147
1147
|
/* case GRN_PTR: */
|
1148
1148
|
/* case GRN_UVECTOR: */
|
1149
1149
|
/* case GRN_PVECTOR: */
|
1150
|
-
|
1150
|
+
case GRN_VECTOR:
|
1151
|
+
return GRNVECTOR2RVAL(context, obj);
|
1152
|
+
break;
|
1151
1153
|
/* case GRN_MSG: */
|
1152
1154
|
/* case GRN_QUERY: */
|
1153
1155
|
/* case GRN_ACCESSOR: */
|
@@ -68,13 +68,19 @@ static VALUE
|
|
68
68
|
rb_grn_variable_get_value (VALUE self)
|
69
69
|
{
|
70
70
|
grn_ctx *context = NULL;
|
71
|
-
grn_obj *variable;
|
71
|
+
grn_obj *variable, *value;
|
72
72
|
|
73
73
|
rb_grn_variable_deconstruct(SELF(self), &variable, &context,
|
74
74
|
NULL, NULL,
|
75
75
|
NULL, NULL);
|
76
76
|
|
77
|
-
|
77
|
+
if (variable->header.type == GRN_PTR) {
|
78
|
+
value = GRN_PTR_VALUE(variable);
|
79
|
+
} else {
|
80
|
+
value = variable;
|
81
|
+
}
|
82
|
+
|
83
|
+
return GRNOBJ2RVAL(Qnil, context, value, self);
|
78
84
|
}
|
79
85
|
|
80
86
|
/*
|
@@ -83,7 +89,7 @@ rb_grn_variable_get_value (VALUE self)
|
|
83
89
|
* @overload value=(value)
|
84
90
|
*/
|
85
91
|
static VALUE
|
86
|
-
rb_grn_variable_set_value (VALUE self, VALUE
|
92
|
+
rb_grn_variable_set_value (VALUE self, VALUE rb_value)
|
87
93
|
{
|
88
94
|
grn_ctx *context = NULL;
|
89
95
|
grn_obj *variable;
|
@@ -91,7 +97,14 @@ rb_grn_variable_set_value (VALUE self, VALUE value)
|
|
91
97
|
rb_grn_variable_deconstruct(SELF(self), &variable, &context,
|
92
98
|
NULL, NULL,
|
93
99
|
NULL, NULL);
|
94
|
-
|
100
|
+
if (variable->header.type == GRN_PTR) {
|
101
|
+
grn_obj *value = NULL;
|
102
|
+
RVAL2GRNOBJ(rb_value, context, &value);
|
103
|
+
GRN_PTR_SET(context, variable, value);
|
104
|
+
} else {
|
105
|
+
RVAL2GRNOBJ(rb_value, context, &variable);
|
106
|
+
}
|
107
|
+
|
95
108
|
return Qnil;
|
96
109
|
}
|
97
110
|
|
data/ext/groonga/rb-grn.h
CHANGED
@@ -76,7 +76,7 @@ RB_GRN_BEGIN_DECLS
|
|
76
76
|
|
77
77
|
#define RB_GRN_MAJOR_VERSION 3
|
78
78
|
#define RB_GRN_MINOR_VERSION 0
|
79
|
-
#define RB_GRN_MICRO_VERSION
|
79
|
+
#define RB_GRN_MICRO_VERSION 4
|
80
80
|
|
81
81
|
#define RB_GRN_QUERY_DEFAULT_MAX_EXPRESSIONS 32
|
82
82
|
|
@@ -212,6 +212,7 @@ RB_GRN_VAR VALUE rb_eGrnError;
|
|
212
212
|
RB_GRN_VAR VALUE rb_eGrnClosed;
|
213
213
|
RB_GRN_VAR VALUE rb_eGrnNoSuchColumn;
|
214
214
|
RB_GRN_VAR VALUE rb_eGrnInvalidArgument;
|
215
|
+
RB_GRN_VAR VALUE rb_eGrnNoMemoryAvailable;
|
215
216
|
RB_GRN_VAR VALUE rb_cGrnObject;
|
216
217
|
RB_GRN_VAR VALUE rb_mGrnEncodingSupport;
|
217
218
|
RB_GRN_VAR VALUE rb_cGrnDatabase;
|
data/lib/1.9/groonga.so
CHANGED
Binary file
|
data/lib/2.0/groonga.so
CHANGED
Binary file
|
data/lib/groonga/record.rb
CHANGED
@@ -15,9 +15,11 @@
|
|
15
15
|
# License along with this library; if not, write to the Free Software
|
16
16
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
17
17
|
|
18
|
-
require
|
18
|
+
require "English"
|
19
19
|
require "time"
|
20
20
|
|
21
|
+
require "groonga/sub-records"
|
22
|
+
|
21
23
|
module Groonga
|
22
24
|
class Record
|
23
25
|
# レコードが所属するテーブル
|
@@ -87,7 +89,7 @@ module Groonga
|
|
87
89
|
# @option value_with_weight [Integer or nil] :weight (nil)
|
88
90
|
# The weight for the value. You need to use vector column and
|
89
91
|
# weight supported index column for weight. See
|
90
|
-
# {Groonga
|
92
|
+
# {Groonga::Table#set_column_value} for details.
|
91
93
|
#
|
92
94
|
# @example Set a new value with weight "2"
|
93
95
|
# user["tags"] = [{:value => "groonga", :weight => 2}]
|
@@ -316,6 +318,11 @@ module Groonga
|
|
316
318
|
@table.exist?(@id)
|
317
319
|
end
|
318
320
|
|
321
|
+
# @return [SubRecords] Sub records of the record.
|
322
|
+
def sub_records
|
323
|
+
SubRecords.new(self)
|
324
|
+
end
|
325
|
+
|
319
326
|
# @private
|
320
327
|
def methods(include_inherited=true)
|
321
328
|
original_methods = super
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
#
|
3
|
+
# Copyright (C) 2013 Kouhei Sutou <kou@clear-code.com>
|
4
|
+
#
|
5
|
+
# This library is free software; you can redistribute it and/or
|
6
|
+
# modify it under the terms of the GNU Lesser General Public
|
7
|
+
# License version 2.1 as published by the Free Software Foundation.
|
8
|
+
#
|
9
|
+
# This library is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
12
|
+
# Lesser General Public License for more details.
|
13
|
+
#
|
14
|
+
# You should have received a copy of the GNU Lesser General Public
|
15
|
+
# License along with this library; if not, write to the Free Software
|
16
|
+
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
17
|
+
|
18
|
+
module Groonga
|
19
|
+
# Represents sub records of a {Record}. Grouped result set by
|
20
|
+
# {Table#group} only has sub records.
|
21
|
+
#
|
22
|
+
# {SubRecords} acts like an ::Array.
|
23
|
+
class SubRecords
|
24
|
+
include Enumerable
|
25
|
+
|
26
|
+
# The record that has this sub records.
|
27
|
+
attr_reader :record
|
28
|
+
|
29
|
+
# Creates a sub records container for the _record_.
|
30
|
+
#
|
31
|
+
# Normally, users don't need to instantiate {SubRecords}
|
32
|
+
# directly. {Record#sub_records} creates and returns a
|
33
|
+
# {SubRecords}.
|
34
|
+
#
|
35
|
+
# @param record [Record] The record that has this sub records.
|
36
|
+
def initialize(record)
|
37
|
+
@record = record
|
38
|
+
end
|
39
|
+
|
40
|
+
# @yield [record] Gives a sub record to the block.
|
41
|
+
# @yieldparam record [Record] A sub record.
|
42
|
+
# @return [void]
|
43
|
+
def each(&block)
|
44
|
+
@record.table.each_sub_record(@record.record_raw_id, &block)
|
45
|
+
end
|
46
|
+
|
47
|
+
# @return [Array<Record>] Sub records as ::Array.
|
48
|
+
def to_a
|
49
|
+
@sub_records ||= super
|
50
|
+
end
|
51
|
+
|
52
|
+
# Acts as ::Array
|
53
|
+
alias_method :to_ary, :to_a
|
54
|
+
|
55
|
+
# @param index [Integer] A 0-origin index.
|
56
|
+
# @return [Record] A sub record at _index_.
|
57
|
+
def [](index)
|
58
|
+
to_a[index]
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
data/rroonga-build.rb
CHANGED
data/rroonga.gemspec
CHANGED
@@ -76,7 +76,7 @@ Gem::Specification.new do |s|
|
|
76
76
|
|
77
77
|
s.homepage = "http://groonga.rubyforge.org/#about-rroonga"
|
78
78
|
s.licenses = ["LGPLv2"]
|
79
|
-
s.require_paths = ["lib"]
|
79
|
+
s.require_paths = ["lib", "ext/groonga"]
|
80
80
|
s.rubyforge_project = "groonga"
|
81
81
|
|
82
82
|
s.required_ruby_version = ">= 1.9.3"
|
data/test/test-array.rb
CHANGED
@@ -203,10 +203,30 @@ EXPECTED_OUTPUT
|
|
203
203
|
end
|
204
204
|
end
|
205
205
|
|
206
|
+
def test_unblock
|
207
|
+
IO.pipe do |read_io, write_io|
|
208
|
+
Tempfile.open("not_blocked_pull.rb") do |pull_rb|
|
209
|
+
pull_rb.puts(pull_rb_source(":block? => true"))
|
210
|
+
pull_rb.close
|
211
|
+
|
212
|
+
pid = spawn({}, RbConfig.ruby, pull_rb.path, :out => write_io)
|
213
|
+
assert_equal("start", read_io.gets.chomp)
|
214
|
+
Process.kill(:TERM, pid)
|
215
|
+
@queue.unblock
|
216
|
+
assert_equal("SIGTERM", read_io.gets.chomp)
|
217
|
+
wait_finished(pid)
|
218
|
+
write_io.close
|
219
|
+
assert_equal("done", read_io.read.chomp)
|
220
|
+
end
|
221
|
+
end
|
222
|
+
end
|
223
|
+
|
206
224
|
private
|
207
225
|
def pull_rb_source(options)
|
208
226
|
base_dir = File.expand_path(File.join(File.dirname(__FILE__), ".."))
|
209
227
|
<<-CODE
|
228
|
+
$stdout.sync = true
|
229
|
+
|
210
230
|
base_dir = #{base_dir.dump}
|
211
231
|
ext_dir = File.join(base_dir, "ext", "groonga")
|
212
232
|
lib_dir = File.join(base_dir, "lib")
|
@@ -216,6 +236,10 @@ $LOAD_PATH.unshift(lib_dir)
|
|
216
236
|
|
217
237
|
require "groonga"
|
218
238
|
|
239
|
+
trap(:TERM) do
|
240
|
+
puts("SIGTERM")
|
241
|
+
end
|
242
|
+
|
219
243
|
puts("start")
|
220
244
|
Groonga::Context.default.open_database(#{@database_path.to_s.dump}) do
|
221
245
|
queue = Groonga["Queue"]
|
@@ -226,5 +250,16 @@ end
|
|
226
250
|
puts("done")
|
227
251
|
CODE
|
228
252
|
end
|
253
|
+
|
254
|
+
def wait_finished(pid)
|
255
|
+
n_retries = 3
|
256
|
+
n_retries.times do |i|
|
257
|
+
@queue.unblock
|
258
|
+
finished_pid = Process.waitpid(pid, Process::WNOHANG)
|
259
|
+
return if finished_pid
|
260
|
+
sleep((2 ** i) * 0.1)
|
261
|
+
end
|
262
|
+
Process.waitpid(pid)
|
263
|
+
end
|
229
264
|
end
|
230
265
|
end
|
data/test/test-context.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2009-
|
1
|
+
# Copyright (C) 2009-2013 Kouhei Sutou <kou@clear-code.com>
|
2
2
|
#
|
3
3
|
# This library is free software; you can redistribute it and/or
|
4
4
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -41,6 +41,7 @@ class ContextTest < Test::Unit::TestCase
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def test_create_temporary_database
|
44
|
+
Groonga::Logger.register(nil)
|
44
45
|
before_files = @tmp_dir.children
|
45
46
|
context = Groonga::Context.new
|
46
47
|
database = context.create_database
|
data/test/test-database.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2009-
|
1
|
+
# Copyright (C) 2009-2013 Kouhei Sutou <kou@clear-code.com>
|
2
2
|
#
|
3
3
|
# This library is free software; you can redistribute it and/or
|
4
4
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -29,6 +29,7 @@ class DatabaseTest < Test::Unit::TestCase
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def test_temporary
|
32
|
+
Groonga::Logger.register(nil)
|
32
33
|
before_files = @tmp_dir.children
|
33
34
|
database = Groonga::Database.create
|
34
35
|
assert_nil(database.name)
|
data/test/test-expression.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
#
|
3
|
-
# Copyright (C) 2009-
|
3
|
+
# Copyright (C) 2009-2013 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
|
@@ -30,9 +30,9 @@ class ExpressionTest < Test::Unit::TestCase
|
|
30
30
|
expression.append_object(ryoqun)
|
31
31
|
expression.append_object(mori)
|
32
32
|
|
33
|
-
assert_equal("ryoqun", expression["user"])
|
34
|
-
assert_equal("ryoqun", expression[0])
|
35
|
-
assert_equal("mori", expression[1])
|
33
|
+
assert_equal("ryoqun", expression["user"].value)
|
34
|
+
assert_equal("ryoqun", expression[0].value)
|
35
|
+
assert_equal("mori", expression[1].value)
|
36
36
|
end
|
37
37
|
|
38
38
|
def test_get_value
|
@@ -131,4 +131,14 @@ class ExpressionTest < Test::Unit::TestCase
|
|
131
131
|
snippet.execute("ラングバプロジェクトはカラムストア機能も"))
|
132
132
|
snippet.close
|
133
133
|
end
|
134
|
+
|
135
|
+
class VariableTest < self
|
136
|
+
def test_reference
|
137
|
+
expression = Groonga::Expression.new
|
138
|
+
variable = expression.define_variable(:name => "$condition",
|
139
|
+
:reference => true)
|
140
|
+
variable.value = "TODO: Change me to expression"
|
141
|
+
assert_equal("TODO: Change me to expression", variable.value)
|
142
|
+
end
|
143
|
+
end
|
134
144
|
end
|
@@ -0,0 +1,109 @@
|
|
1
|
+
# Copyright (C) 2013 Kouhei Sutou <kou@clear-code.com>
|
2
|
+
#
|
3
|
+
# This library is free software; you can redistribute it and/or
|
4
|
+
# modify it under the terms of the GNU Lesser General Public
|
5
|
+
# License version 2.1 as published by the Free Software Foundation.
|
6
|
+
#
|
7
|
+
# This library is distributed in the hope that it will be useful,
|
8
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
9
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
10
|
+
# Lesser General Public License for more details.
|
11
|
+
#
|
12
|
+
# You should have received a copy of the GNU Lesser General Public
|
13
|
+
# License along with this library; if not, write to the Free Software
|
14
|
+
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
15
|
+
|
16
|
+
class SubRecordsTest < Test::Unit::TestCase
|
17
|
+
include GroongaTestUtils
|
18
|
+
|
19
|
+
def setup
|
20
|
+
setup_database
|
21
|
+
setup_schema
|
22
|
+
setup_data
|
23
|
+
setup_searched
|
24
|
+
end
|
25
|
+
|
26
|
+
def setup_schema
|
27
|
+
Groonga::Schema.define do |schema|
|
28
|
+
schema.create_table("Bookmarks", :type => :hash) do |table|
|
29
|
+
table.text("title")
|
30
|
+
end
|
31
|
+
|
32
|
+
schema.create_table("Comments", :type => :array) do |table|
|
33
|
+
table.reference("bookmark")
|
34
|
+
table.text("content")
|
35
|
+
table.int32("rank")
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def setup_data
|
41
|
+
setup_bookmarks
|
42
|
+
setup_comments
|
43
|
+
end
|
44
|
+
|
45
|
+
def setup_bookmarks
|
46
|
+
@bookmarks = Groonga["Bookmarks"]
|
47
|
+
@groonga = @bookmarks.add("http://groonga.org/", :title => "groonga")
|
48
|
+
@ruby = @bookmarks.add("http://ruby-lang.org/", :title => "Ruby")
|
49
|
+
end
|
50
|
+
|
51
|
+
def setup_comments
|
52
|
+
@comments = Groonga["Comments"]
|
53
|
+
@comments.add(:bookmark => @groonga,
|
54
|
+
:content => "garbage comment1",
|
55
|
+
:rank => 0)
|
56
|
+
@comments.add(:bookmark => @groonga,
|
57
|
+
:content => "garbage comment2",
|
58
|
+
:rank => 0)
|
59
|
+
@comments.add(:bookmark => @groonga,
|
60
|
+
:content => "full-text search",
|
61
|
+
:rank => 1)
|
62
|
+
@comments.add(:bookmark => @groonga,
|
63
|
+
:content => "column store",
|
64
|
+
:rank => 5)
|
65
|
+
@comments.add(:bookmark => @ruby,
|
66
|
+
:content => "object oriented script language",
|
67
|
+
:rank => 100)
|
68
|
+
@comments.add(:bookmark => @ruby,
|
69
|
+
:content => "multi paradigm programming language",
|
70
|
+
:rank => 80)
|
71
|
+
end
|
72
|
+
|
73
|
+
def setup_searched
|
74
|
+
@records = @comments.select do |record|
|
75
|
+
record.rank > 0
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
def test_array_reference
|
80
|
+
grouped_records = @records.group("bookmark", :max_n_sub_records => 2)
|
81
|
+
groups = grouped_records.collect do |record|
|
82
|
+
[record.title, record.sub_records[0].content]
|
83
|
+
end
|
84
|
+
assert_equal([
|
85
|
+
[
|
86
|
+
"groonga",
|
87
|
+
"full-text search",
|
88
|
+
],
|
89
|
+
[
|
90
|
+
"Ruby",
|
91
|
+
"object oriented script language",
|
92
|
+
],
|
93
|
+
],
|
94
|
+
groups)
|
95
|
+
end
|
96
|
+
|
97
|
+
def test_to_ary
|
98
|
+
grouped_records = @records.group("bookmark", :max_n_sub_records => 2)
|
99
|
+
sub_record1, sub_record2 = grouped_records.first.sub_records
|
100
|
+
assert_equal([
|
101
|
+
"full-text search",
|
102
|
+
"column store",
|
103
|
+
],
|
104
|
+
[
|
105
|
+
sub_record1.content,
|
106
|
+
sub_record2.content,
|
107
|
+
])
|
108
|
+
end
|
109
|
+
end
|
data/test/test-table.rb
CHANGED
@@ -681,6 +681,110 @@ class TableTest < Test::Unit::TestCase
|
|
681
681
|
assert_not_predicate(bookmarks, :builtin?)
|
682
682
|
end
|
683
683
|
|
684
|
+
class GroupTest < self
|
685
|
+
class MaxNSubRecordsTest < self
|
686
|
+
setup
|
687
|
+
def setup_schema
|
688
|
+
Groonga::Schema.define do |schema|
|
689
|
+
schema.create_table("Bookmarks", :type => :hash) do |table|
|
690
|
+
table.text("title")
|
691
|
+
end
|
692
|
+
|
693
|
+
schema.create_table("Comments", :type => :array) do |table|
|
694
|
+
table.reference("bookmark")
|
695
|
+
table.text("content")
|
696
|
+
table.int32("rank")
|
697
|
+
end
|
698
|
+
end
|
699
|
+
end
|
700
|
+
|
701
|
+
setup
|
702
|
+
def setup_data
|
703
|
+
setup_bookmarks
|
704
|
+
setup_comments
|
705
|
+
end
|
706
|
+
|
707
|
+
def setup_bookmarks
|
708
|
+
@bookmarks = Groonga["Bookmarks"]
|
709
|
+
@groonga = @bookmarks.add("http://groonga.org/", :title => "groonga")
|
710
|
+
@ruby = @bookmarks.add("http://ruby-lang.org/", :title => "Ruby")
|
711
|
+
end
|
712
|
+
|
713
|
+
def setup_comments
|
714
|
+
@comments = Groonga["Comments"]
|
715
|
+
@comments.add(:bookmark => @groonga,
|
716
|
+
:content => "garbage comment1",
|
717
|
+
:rank => 0)
|
718
|
+
@comments.add(:bookmark => @groonga,
|
719
|
+
:content => "garbage comment2",
|
720
|
+
:rank => 0)
|
721
|
+
@comments.add(:bookmark => @groonga,
|
722
|
+
:content => "full-text search",
|
723
|
+
:rank => 1)
|
724
|
+
@comments.add(:bookmark => @groonga,
|
725
|
+
:content => "column store",
|
726
|
+
:rank => 5)
|
727
|
+
@comments.add(:bookmark => @ruby,
|
728
|
+
:content => "object oriented script language",
|
729
|
+
:rank => 100)
|
730
|
+
@comments.add(:bookmark => @ruby,
|
731
|
+
:content => "multi paradigm programming language",
|
732
|
+
:rank => 80)
|
733
|
+
end
|
734
|
+
|
735
|
+
setup
|
736
|
+
def setup_searched
|
737
|
+
@records = @comments.select do |record|
|
738
|
+
record.rank > 0
|
739
|
+
end
|
740
|
+
end
|
741
|
+
|
742
|
+
def test_upper_limit
|
743
|
+
grouped_records = @records.group("bookmark", :max_n_sub_records => 2)
|
744
|
+
groups = grouped_records.collect do |record|
|
745
|
+
sub_record_contents = record.sub_records.collect do |sub_record|
|
746
|
+
sub_record.content
|
747
|
+
end
|
748
|
+
[record.title, sub_record_contents]
|
749
|
+
end
|
750
|
+
assert_equal([
|
751
|
+
[
|
752
|
+
"groonga",
|
753
|
+
[
|
754
|
+
"full-text search",
|
755
|
+
"column store",
|
756
|
+
],
|
757
|
+
],
|
758
|
+
[
|
759
|
+
"Ruby",
|
760
|
+
[
|
761
|
+
"object oriented script language",
|
762
|
+
"multi paradigm programming language",
|
763
|
+
],
|
764
|
+
],
|
765
|
+
],
|
766
|
+
groups)
|
767
|
+
end
|
768
|
+
|
769
|
+
def test_less_than_limit
|
770
|
+
sorted = @records.sort([{:key => "rank", :order => :descending}],
|
771
|
+
:limit => 3, :offset => 0)
|
772
|
+
grouped_records = sorted.group("bookmark", :max_n_sub_records => 2)
|
773
|
+
groups = grouped_records.collect do |record|
|
774
|
+
sub_record_ranks = record.sub_records.collect do |sub_record|
|
775
|
+
sub_record.rank
|
776
|
+
end
|
777
|
+
[record.title, sub_record_ranks]
|
778
|
+
end
|
779
|
+
assert_equal([
|
780
|
+
["Ruby", [100, 80]],
|
781
|
+
["groonga", [5]]
|
782
|
+
],
|
783
|
+
groups)
|
784
|
+
end
|
785
|
+
end
|
786
|
+
end
|
787
|
+
|
684
788
|
class OtherProcessTest < self
|
685
789
|
def test_create
|
686
790
|
by_other_process do
|