rroonga 2.0.0-x86-mingw32 → 2.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.
- data/Rakefile +3 -2
- data/ext/groonga/rb-grn-expression.c +4 -3
- data/ext/groonga/rb-grn-object.c +13 -0
- data/ext/groonga/rb-grn-snippet.c +32 -126
- data/ext/groonga/rb-grn.h +14 -11
- data/lib/1.8/groonga.so +0 -0
- data/lib/1.9/groonga.so +0 -0
- data/rroonga-build.rb +1 -1
- data/vendor/local/bin/{grntest.exe → 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/plugin.h +1 -1
- data/vendor/local/include/groonga/groonga.h +10 -3
- 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/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/commands/suggest.txt +19 -0
- data/vendor/local/share/doc/groonga/en/html/_sources/community.txt +2 -2
- data/vendor/local/share/doc/groonga/en/html/_sources/install.txt +72 -8
- data/vendor/local/share/doc/groonga/en/html/_sources/news.txt +45 -1
- data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/data.txt +112 -33
- data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/introduction.txt +109 -99
- data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/network.txt +76 -40
- data/vendor/local/share/doc/groonga/en/html/_sources/type.txt +30 -21
- data/vendor/local/share/doc/groonga/en/html/_static/favicon.ico +0 -0
- data/vendor/local/share/doc/groonga/en/html/_static/groonga.css +309 -101
- data/vendor/local/share/doc/groonga/en/html/_static/jquery.js +4 -154
- data/vendor/local/share/doc/groonga/en/html/_static/logo.png +0 -0
- data/vendor/local/share/doc/groonga/en/html/_static/navigation-bar.png +0 -0
- data/vendor/local/share/doc/groonga/en/html/_static/underscore.js +29 -21
- data/vendor/local/share/doc/groonga/en/html/characteristic.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/command_version.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/commands/cache_limit.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/commands/check.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/commands/clearlock.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/commands/column_create.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/commands/column_list.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/commands/column_remove.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/commands/define_selector.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/commands/defrag.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/commands/delete.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/commands/dump.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/commands/load.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/commands/log_level.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/commands/log_put.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/commands/log_reopen.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/commands/quit.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/commands/select.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/commands/shutdown.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/commands/status.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/commands/suggest.html +21 -1
- data/vendor/local/share/doc/groonga/en/html/commands/table_create.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/commands/table_list.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/commands/table_remove.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/commands/view_add.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/commands.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/community.html +3 -3
- data/vendor/local/share/doc/groonga/en/html/contribution/development/com.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/contribution/development/document.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/contribution/development/query.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/contribution/development/test.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/contribution/development.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/contribution/documentation/c-api.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/contribution/documentation/i18n.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/contribution/documentation.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/contribution/report.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/contribution.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/executables/grnslap.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/executables/grntest.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/executables/groonga-http.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/executables/groonga-suggest-create-dataset.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/executables/groonga.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/executables.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/expr.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/functions/edit_distance.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/functions/geo_distance.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/functions/geo_in_circle.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/functions/geo_in_rectangle.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/functions/now.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/functions/rand.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/functions.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/genindex.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/geolocation_search.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/index.html +25 -18
- data/vendor/local/share/doc/groonga/en/html/indexing.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/install.html +59 -9
- data/vendor/local/share/doc/groonga/en/html/limitations.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/log.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/news/0.x.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/news/1.0.x.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/news/1.1.x.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/news/1.2.x.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/news/senna.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/news.html +66 -15
- data/vendor/local/share/doc/groonga/en/html/objects.inv +0 -0
- data/vendor/local/share/doc/groonga/en/html/output.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/pseudo_column.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/reference.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/search.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/searchindex.js +1 -1
- data/vendor/local/share/doc/groonga/en/html/spec/search.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/spec.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/suggest/completion.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/suggest/correction.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/suggest/introduction.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/suggest/suggestion.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/suggest/tutorial.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/suggest.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/troubleshooting/different_results_with_the_same_keyword.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/troubleshooting.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/tutorial/data.html +141 -53
- data/vendor/local/share/doc/groonga/en/html/tutorial/drilldown.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/tutorial/index.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/tutorial/introduction.html +112 -106
- data/vendor/local/share/doc/groonga/en/html/tutorial/lexicon.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/tutorial/match_columns.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/tutorial/micro_blog.html +2 -2
- data/vendor/local/share/doc/groonga/en/html/tutorial/network.html +92 -58
- data/vendor/local/share/doc/groonga/en/html/tutorial/patricia_trie.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/tutorial/query_expansion.html +1 -1
- data/vendor/local/share/doc/groonga/en/html/tutorial/search.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/tutorial.html +21 -14
- data/vendor/local/share/doc/groonga/en/html/type.html +30 -22
- data/vendor/local/share/doc/groonga/ja/html/.buildinfo +1 -1
- data/vendor/local/share/doc/groonga/ja/html/_sources/commands/suggest.txt +19 -0
- data/vendor/local/share/doc/groonga/ja/html/_sources/community.txt +2 -2
- data/vendor/local/share/doc/groonga/ja/html/_sources/install.txt +72 -8
- data/vendor/local/share/doc/groonga/ja/html/_sources/news.txt +45 -1
- data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/data.txt +112 -33
- data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/introduction.txt +109 -99
- data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/network.txt +76 -40
- data/vendor/local/share/doc/groonga/ja/html/_sources/type.txt +30 -21
- data/vendor/local/share/doc/groonga/ja/html/_static/favicon.ico +0 -0
- data/vendor/local/share/doc/groonga/ja/html/_static/groonga.css +309 -101
- data/vendor/local/share/doc/groonga/ja/html/_static/jquery.js +4 -154
- data/vendor/local/share/doc/groonga/ja/html/_static/logo.png +0 -0
- data/vendor/local/share/doc/groonga/ja/html/_static/navigation-bar.png +0 -0
- data/vendor/local/share/doc/groonga/ja/html/_static/underscore.js +29 -21
- data/vendor/local/share/doc/groonga/ja/html/characteristic.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/command_version.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/commands/cache_limit.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/commands/check.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/commands/clearlock.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/commands/column_create.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/commands/column_list.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/commands/column_remove.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/commands/define_selector.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/commands/defrag.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/commands/delete.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/commands/dump.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/commands/load.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/commands/log_level.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/commands/log_put.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/commands/log_reopen.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/commands/quit.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/commands/select.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/commands/shutdown.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/commands/status.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/commands/suggest.html +19 -1
- data/vendor/local/share/doc/groonga/ja/html/commands/table_create.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/commands/table_list.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/commands/table_remove.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/commands/view_add.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/commands.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/community.html +3 -3
- data/vendor/local/share/doc/groonga/ja/html/contribution/development/com.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/contribution/development/document.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/contribution/development/query.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/contribution/development/test.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/contribution/development.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/contribution/documentation/c-api.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/contribution/documentation/i18n.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/contribution/documentation.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/contribution/report.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/contribution.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/executables/grnslap.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/executables/grntest.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/executables/groonga-http.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/executables/groonga-suggest-create-dataset.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/executables/groonga.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/executables.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/expr.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/functions/edit_distance.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/functions/geo_distance.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/functions/geo_in_circle.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/functions/geo_in_rectangle.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/functions/now.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/functions/rand.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/functions.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/genindex.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/geolocation_search.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/index.html +25 -18
- data/vendor/local/share/doc/groonga/ja/html/indexing.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/install.html +72 -22
- data/vendor/local/share/doc/groonga/ja/html/limitations.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/log.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/news/0.x.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/news/1.0.x.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/news/1.1.x.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/news/1.2.x.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/news/senna.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/news.html +60 -14
- data/vendor/local/share/doc/groonga/ja/html/objects.inv +0 -0
- data/vendor/local/share/doc/groonga/ja/html/output.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/pseudo_column.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/reference.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/search.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/searchindex.js +1 -1
- data/vendor/local/share/doc/groonga/ja/html/spec/search.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/spec.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/suggest/completion.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/suggest/correction.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/suggest/introduction.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/suggest/suggestion.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/suggest/tutorial.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/suggest.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/troubleshooting/different_results_with_the_same_keyword.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/troubleshooting.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/tutorial/data.html +141 -53
- data/vendor/local/share/doc/groonga/ja/html/tutorial/drilldown.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/tutorial/index.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/tutorial/introduction.html +108 -102
- data/vendor/local/share/doc/groonga/ja/html/tutorial/lexicon.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/tutorial/match_columns.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/tutorial/micro_blog.html +2 -2
- data/vendor/local/share/doc/groonga/ja/html/tutorial/network.html +92 -55
- data/vendor/local/share/doc/groonga/ja/html/tutorial/patricia_trie.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/tutorial/query_expansion.html +1 -1
- data/vendor/local/share/doc/groonga/ja/html/tutorial/search.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/tutorial.html +21 -14
- data/vendor/local/share/doc/groonga/ja/html/type.html +30 -22
- data/vendor/local/share/doc/groonga/source/commands/suggest.txt +19 -0
- data/vendor/local/share/doc/groonga/source/community.txt +2 -2
- data/vendor/local/share/doc/groonga/source/example/tutorial/data-1.log +2 -15
- data/vendor/local/share/doc/groonga/source/example/tutorial/data-2.log +11 -7
- data/vendor/local/share/doc/groonga/source/example/tutorial/data-3.log +13 -7
- data/vendor/local/share/doc/groonga/source/example/tutorial/data-4.log +13 -0
- data/vendor/local/share/doc/groonga/source/example/tutorial/data-5.log +13 -0
- data/vendor/local/share/doc/groonga/source/example/tutorial/data-6.log +13 -0
- data/vendor/local/share/doc/groonga/source/example/tutorial/data-7.log +10 -0
- data/vendor/local/share/doc/groonga/source/example/tutorial/data-8.log +10 -0
- data/vendor/local/share/doc/groonga/source/example/tutorial/introduction-1.log +0 -2
- data/vendor/local/share/doc/groonga/source/example/tutorial/introduction-10.log +2 -2
- data/vendor/local/share/doc/groonga/source/example/tutorial/introduction-11.log +2 -2
- data/vendor/local/share/doc/groonga/source/example/tutorial/introduction-12.log +2 -2
- data/vendor/local/share/doc/groonga/source/example/tutorial/introduction-13.log +2 -2
- data/vendor/local/share/doc/groonga/source/example/tutorial/introduction-14.log +2 -6
- data/vendor/local/share/doc/groonga/source/example/tutorial/introduction-15.log +6 -2
- data/vendor/local/share/doc/groonga/source/example/tutorial/introduction-16.log +2 -2
- data/vendor/local/share/doc/groonga/source/example/tutorial/introduction-17.log +2 -2
- data/vendor/local/share/doc/groonga/source/example/tutorial/introduction-18.log +5 -0
- data/vendor/local/share/doc/groonga/source/example/tutorial/introduction-2.log +3 -2
- data/vendor/local/share/doc/groonga/source/example/tutorial/introduction-3.log +2 -2
- data/vendor/local/share/doc/groonga/source/example/tutorial/introduction-4.log +1 -3
- data/vendor/local/share/doc/groonga/source/example/tutorial/introduction-5.log +4 -2
- data/vendor/local/share/doc/groonga/source/example/tutorial/introduction-6.log +13 -2
- data/vendor/local/share/doc/groonga/source/example/tutorial/introduction-7.log +2 -13
- data/vendor/local/share/doc/groonga/source/example/tutorial/introduction-8.log +2 -2
- data/vendor/local/share/doc/groonga/source/example/tutorial/introduction-9.log +2 -2
- data/vendor/local/share/doc/groonga/source/example/tutorial/network-1.log +1 -1
- data/vendor/local/share/doc/groonga/source/example/tutorial/network-3.log +6 -6
- data/vendor/local/share/doc/groonga/source/install.txt +72 -8
- data/vendor/local/share/doc/groonga/source/news.txt +45 -1
- data/vendor/local/share/doc/groonga/source/tutorial/data.txt +112 -33
- data/vendor/local/share/doc/groonga/source/tutorial/introduction.txt +109 -99
- data/vendor/local/share/doc/groonga/source/tutorial/network.txt +76 -40
- data/vendor/local/share/doc/groonga/source/type.txt +30 -21
- data/vendor/local/share/groonga/html/admin/css/admin.css +1 -1
- data/vendor/local/share/groonga/html/admin/favicon.ico +0 -0
- data/vendor/local/share/groonga/html/admin/favicon.png +0 -0
- data/vendor/local/share/groonga/html/admin/favicon.svg +107 -547
- data/vendor/local/share/groonga/html/admin/images/groonga.png +0 -0
- data/vendor/local/share/groonga/html/admin/index.html +1 -1
- data/vendor/local/share/groonga/images/logo/groonga-icon-foreground-white.png +0 -0
- data/vendor/local/share/groonga/images/logo/groonga-icon-foreground-white.svg +118 -0
- data/vendor/local/share/groonga/images/logo/groonga-icon-full-size.png +0 -0
- data/vendor/local/share/groonga/images/logo/groonga-icon-full-size.svg +97 -0
- data/vendor/local/share/groonga/images/logo/groonga-icon.png +0 -0
- data/vendor/local/share/groonga/images/logo/groonga-icon.svg +93 -0
- data/vendor/local/share/groonga/images/logo/groonga-logo-foreground-white.png +0 -0
- data/vendor/local/share/groonga/images/logo/groonga-logo-foreground-white.svg +108 -0
- data/vendor/local/share/groonga/images/logo/groonga-logo.png +0 -0
- data/vendor/local/share/groonga/images/logo/groonga-logo.svg +118 -0
- data/vendor/local/share/groonga/images/logo/groonga-powered-by-banner-bar-foreground-white.png +0 -0
- data/vendor/local/share/groonga/images/logo/groonga-powered-by-banner-bar-foreground-white.svg +170 -0
- data/vendor/local/share/groonga/images/logo/groonga-powered-by-banner-bar.png +0 -0
- data/vendor/local/share/groonga/images/logo/groonga-powered-by-banner-bar.svg +186 -0
- data/vendor/local/share/groonga/images/logo/groonga-powered-by-banner-foreground-white.png +0 -0
- data/vendor/local/share/groonga/images/logo/groonga-powered-by-banner-foreground-white.svg +183 -0
- data/vendor/local/share/groonga/images/logo/groonga-powered-by-banner-large.png +0 -0
- data/vendor/local/share/groonga/images/logo/groonga-powered-by-banner-large.svg +179 -0
- data/vendor/local/share/groonga/images/logo/groonga-powered-by-banner.png +0 -0
- data/vendor/local/share/groonga/images/logo/groonga-powered-by-banner.svg +201 -0
- data/vendor/local/share/groonga/images/logo/mroonga-icon-foreground-white.png +0 -0
- data/vendor/local/share/groonga/images/logo/mroonga-icon-foreground-white.svg +106 -0
- data/vendor/local/share/groonga/images/logo/mroonga-icon-full-size.png +0 -0
- data/vendor/local/share/groonga/images/logo/mroonga-icon-full-size.svg +97 -0
- data/vendor/local/share/groonga/images/logo/mroonga-icon.png +0 -0
- data/vendor/local/share/groonga/images/logo/mroonga-icon.svg +93 -0
- data/vendor/local/share/groonga/images/logo/mroonga-logo-foreground-white.png +0 -0
- data/vendor/local/share/groonga/images/logo/mroonga-logo-foreground-white.svg +122 -0
- data/vendor/local/share/groonga/images/logo/mroonga-logo.png +0 -0
- data/vendor/local/share/groonga/images/logo/mroonga-logo.svg +106 -0
- data/vendor/local/share/groonga/images/logo/nroonga-icon-foreground-white.png +0 -0
- data/vendor/local/share/groonga/images/logo/nroonga-icon-foreground-white.svg +106 -0
- data/vendor/local/share/groonga/images/logo/nroonga-icon-full-size.png +0 -0
- data/vendor/local/share/groonga/images/logo/nroonga-icon-full-size.svg +107 -0
- data/vendor/local/share/groonga/images/logo/nroonga-icon.png +0 -0
- data/vendor/local/share/groonga/images/logo/nroonga-icon.svg +93 -0
- data/vendor/local/share/groonga/images/logo/nroonga-logo-foreground-white.png +0 -0
- data/vendor/local/share/groonga/images/logo/nroonga-logo-foreground-white.svg +122 -0
- data/vendor/local/share/groonga/images/logo/nroonga-logo.png +0 -0
- data/vendor/local/share/groonga/images/logo/nroonga-logo.svg +117 -0
- data/vendor/local/share/groonga/images/logo/rroonga-icon-foreground-white.png +0 -0
- data/vendor/local/share/groonga/images/logo/rroonga-icon-foreground-white.svg +106 -0
- data/vendor/local/share/groonga/images/logo/rroonga-icon-full-size.png +0 -0
- data/vendor/local/share/groonga/images/logo/rroonga-icon-full-size.svg +107 -0
- data/vendor/local/share/groonga/images/logo/rroonga-icon.png +0 -0
- data/vendor/local/share/groonga/images/logo/rroonga-icon.svg +93 -0
- data/vendor/local/share/groonga/images/logo/rroonga-logo-foreground-white.png +0 -0
- data/vendor/local/share/groonga/images/logo/rroonga-logo-foreground-white.svg +122 -0
- data/vendor/local/share/groonga/images/logo/rroonga-logo.png +0 -0
- data/vendor/local/share/groonga/images/logo/rroonga-logo.svg +117 -0
- data/vendor/local/share/man/ja/man1/groonga.1 +510 -214
- data/vendor/local/share/man/man1/groonga.1 +510 -211
- metadata +62 -15
- data/vendor/local/bin/groonga-query-log-analyzer +0 -1419
- data/vendor/local/share/doc/groonga/en/html/_static/default.css +0 -278
- data/vendor/local/share/doc/groonga/en/html/_static/footer-bar.png +0 -0
- data/vendor/local/share/doc/groonga/en/html/_static/menu-header.png +0 -0
- data/vendor/local/share/doc/groonga/en/html/_static/sidebar.js +0 -151
- data/vendor/local/share/doc/groonga/ja/html/_static/default.css +0 -278
- data/vendor/local/share/doc/groonga/ja/html/_static/footer-bar.png +0 -0
- data/vendor/local/share/doc/groonga/ja/html/_static/menu-header.png +0 -0
- data/vendor/local/share/doc/groonga/ja/html/_static/sidebar.js +0 -151
@@ -1,4 +1,4 @@
|
|
1
|
-
.TH "GROONGA" "1" "2012 年
|
1
|
+
.TH "GROONGA" "1" "2012 年 03 月 29 日" "2.0.0" "groonga"
|
2
2
|
.SH NAME
|
3
3
|
groonga \- groongaのドキュメント
|
4
4
|
.
|
@@ -106,9 +106,19 @@ deb\-src http://packages.groonga.org/debian/ squeeze main
|
|
106
106
|
.ft P
|
107
107
|
.fi
|
108
108
|
.sp
|
109
|
-
\fI\%
|
109
|
+
\fI\%MeCab\fP をトークナイザとして使いたいときは、groonga\-tokenizer\-mecabパッケージをインストールしてください。
|
110
110
|
.sp
|
111
|
-
groonga\-
|
111
|
+
groonga\-tokenizer\-mecabパッケージのインストール:
|
112
|
+
.sp
|
113
|
+
.nf
|
114
|
+
.ft C
|
115
|
+
% sudo aptitude \-V \-D \-y install groonga\-tokenizer\-mecab
|
116
|
+
.ft P
|
117
|
+
.fi
|
118
|
+
.sp
|
119
|
+
\fI\%Munin\fP プラグインを提供するパッケージもあります。Muninでgroongaの状態をモニターしたい場合は、groonga\-munin\-pluginsパッケージをインストールしてください。
|
120
|
+
.sp
|
121
|
+
groonga\-munin\-pluginsパッケージのインストール:
|
112
122
|
.sp
|
113
123
|
.nf
|
114
124
|
.ft C
|
@@ -136,7 +146,19 @@ deb\-src http://packages.groonga.org/debian/ wheezy main
|
|
136
146
|
.ft P
|
137
147
|
.fi
|
138
148
|
.sp
|
139
|
-
groonga\-
|
149
|
+
\fI\%MeCab\fP をトークナイザとして使いたいときは、groonga\-tokenizer\-mecabパッケージをインストールしてください。
|
150
|
+
.sp
|
151
|
+
groonga\-tokenizer\-mecabパッケージのインストール:
|
152
|
+
.sp
|
153
|
+
.nf
|
154
|
+
.ft C
|
155
|
+
% sudo aptitude \-V \-D \-y install groonga\-tokenizer\-mecab
|
156
|
+
.ft P
|
157
|
+
.fi
|
158
|
+
.sp
|
159
|
+
\fI\%Munin\fP プラグインを提供するパッケージもあります。Muninでgroongaの状態をモニターしたい場合は、groonga\-munin\-pluginsパッケージをインストールしてください。
|
160
|
+
.sp
|
161
|
+
groonga\-munin\-pluginsパッケージのインストール:
|
140
162
|
.sp
|
141
163
|
.nf
|
142
164
|
.ft C
|
@@ -164,7 +186,19 @@ deb\-src http://packages.groonga.org/debian/ unstable main
|
|
164
186
|
.ft P
|
165
187
|
.fi
|
166
188
|
.sp
|
167
|
-
groonga\-
|
189
|
+
\fI\%MeCab\fP をトークナイザとして使いたいときは、groonga\-tokenizer\-mecabパッケージをインストールしてください。
|
190
|
+
.sp
|
191
|
+
groonga\-tokenizer\-mecabパッケージのインストール:
|
192
|
+
.sp
|
193
|
+
.nf
|
194
|
+
.ft C
|
195
|
+
% sudo aptitude \-V \-D \-y install groonga\-tokenizer\-mecab
|
196
|
+
.ft P
|
197
|
+
.fi
|
198
|
+
.sp
|
199
|
+
\fI\%Munin\fP プラグインを提供するパッケージもあります。Muninでgroongaの状態をモニターしたい場合は、groonga\-munin\-pluginsパッケージをインストールしてください。
|
200
|
+
.sp
|
201
|
+
groonga\-munin\-pluginsパッケージのインストール:
|
168
202
|
.sp
|
169
203
|
.nf
|
170
204
|
.ft C
|
@@ -195,7 +229,19 @@ deb\-src http://packages.groonga.org/ubuntu/ lucid universe
|
|
195
229
|
.ft P
|
196
230
|
.fi
|
197
231
|
.sp
|
198
|
-
groonga\-
|
232
|
+
\fI\%MeCab\fP をトークナイザとして使いたいときは、groonga\-tokenizer\-mecabパッケージをインストールしてください。
|
233
|
+
.sp
|
234
|
+
groonga\-tokenizer\-mecabパッケージのインストール:
|
235
|
+
.sp
|
236
|
+
.nf
|
237
|
+
.ft C
|
238
|
+
% sudo apt\-get \-y install groonga\-tokenizer\-mecab
|
239
|
+
.ft P
|
240
|
+
.fi
|
241
|
+
.sp
|
242
|
+
\fI\%Munin\fP プラグインを提供するパッケージもあります。Muninでgroongaの状態をモニターしたい場合は、groonga\-munin\-pluginsパッケージをインストールしてください。
|
243
|
+
.sp
|
244
|
+
groonga\-munin\-pluginsパッケージのインストール:
|
199
245
|
.sp
|
200
246
|
.nf
|
201
247
|
.ft C
|
@@ -226,7 +272,19 @@ deb\-src http://packages.groonga.org/ubuntu/ natty universe
|
|
226
272
|
.ft P
|
227
273
|
.fi
|
228
274
|
.sp
|
229
|
-
groonga\-
|
275
|
+
\fI\%MeCab\fP をトークナイザとして使いたいときは、groonga\-tokenizer\-mecabパッケージをインストールしてください。
|
276
|
+
.sp
|
277
|
+
groonga\-tokenizer\-mecabパッケージのインストール:
|
278
|
+
.sp
|
279
|
+
.nf
|
280
|
+
.ft C
|
281
|
+
% sudo apt\-get \-y install groonga\-tokenizer\-mecab
|
282
|
+
.ft P
|
283
|
+
.fi
|
284
|
+
.sp
|
285
|
+
\fI\%Munin\fP プラグインを提供するパッケージもあります。Muninでgroongaの状態をモニターしたい場合は、groonga\-munin\-pluginsパッケージをインストールしてください。
|
286
|
+
.sp
|
287
|
+
groonga\-munin\-pluginsパッケージのインストール:
|
230
288
|
.sp
|
231
289
|
.nf
|
232
290
|
.ft C
|
@@ -257,7 +315,19 @@ deb\-src http://packages.groonga.org/ubuntu/ oneiric universe
|
|
257
315
|
.ft P
|
258
316
|
.fi
|
259
317
|
.sp
|
260
|
-
groonga\-
|
318
|
+
\fI\%MeCab\fP をトークナイザとして使いたいときは、groonga\-tokenizer\-mecabパッケージをインストールしてください。
|
319
|
+
.sp
|
320
|
+
groonga\-tokenizer\-mecabパッケージのインストール:
|
321
|
+
.sp
|
322
|
+
.nf
|
323
|
+
.ft C
|
324
|
+
% sudo apt\-get \-y install groonga\-tokenizer\-mecab
|
325
|
+
.ft P
|
326
|
+
.fi
|
327
|
+
.sp
|
328
|
+
\fI\%Munin\fP プラグインを提供するパッケージもあります。Muninでgroongaの状態をモニターしたい場合は、groonga\-munin\-pluginsパッケージをインストールしてください。
|
329
|
+
.sp
|
330
|
+
groonga\-munin\-pluginsパッケージのインストール:
|
261
331
|
.sp
|
262
332
|
.nf
|
263
333
|
.ft C
|
@@ -276,11 +346,21 @@ groonga\-munin\-pluginsパッケージをインストール:
|
|
276
346
|
.ft P
|
277
347
|
.fi
|
278
348
|
.sp
|
279
|
-
\fI\%
|
349
|
+
\fI\%MeCab\fP をトークナイザとして使いたいときは、groonga\-tokenizer\-mecabパッケージをインストールしてください。
|
350
|
+
.sp
|
351
|
+
groonga\-tokenizer\-mecabパッケージのインストール:
|
352
|
+
.sp
|
353
|
+
.nf
|
354
|
+
.ft C
|
355
|
+
% sudo yum install \-y groonga\-tokenizer\-mecab
|
356
|
+
.ft P
|
357
|
+
.fi
|
358
|
+
.sp
|
359
|
+
\fI\%Munin\fP プラグインを提供するパッケージもあります。Muninでgroongaの状態をモニターしたい場合は、groonga\-munin\-pluginsパッケージをインストールしてください。
|
280
360
|
.IP ノート
|
281
|
-
groonga\-munin\-pluginsパッケージはmunin\-nodeパッケージを必要としますが、munin\-nodeパッケージはCentOSの公式リポジトリには含まれていません。munin\-nodeパッケージをyumでインストールするために \fI\%RPMforge\fP リポジトリか \fI\%EPEL\fP リポジトリを有効にする必要があります。
|
361
|
+
groonga\-munin\-pluginsパッケージはmunin\-nodeパッケージを必要としますが、munin\-nodeパッケージはCentOSの公式リポジトリには含まれていません。munin\-nodeパッケージをyumでインストールするために \fI\%Repoforge (RPMforge)\fP リポジトリか \fI\%EPEL\fP リポジトリを有効にする必要があります。
|
282
362
|
.sp
|
283
|
-
i386環境でRPMforgeリポジトリを有効にする:
|
363
|
+
i386環境でRepoforge (RPMforge)リポジトリを有効にする:
|
284
364
|
.sp
|
285
365
|
.nf
|
286
366
|
.ft C
|
@@ -288,7 +368,7 @@ i386環境でRPMforgeリポジトリを有効にする:
|
|
288
368
|
.ft P
|
289
369
|
.fi
|
290
370
|
.sp
|
291
|
-
x86_64環境でRPMforgeリポジトリを有効にする:
|
371
|
+
x86_64環境でRepoforge (RPMforge)リポジトリを有効にする:
|
292
372
|
.sp
|
293
373
|
.nf
|
294
374
|
.ft C
|
@@ -305,7 +385,7 @@ EPELリポジトリを有効にする(環境非依存):
|
|
305
385
|
.fi
|
306
386
|
.RE
|
307
387
|
.sp
|
308
|
-
groonga\-munin\-plugins
|
388
|
+
groonga\-munin\-pluginsパッケージのインストール:
|
309
389
|
.sp
|
310
390
|
.nf
|
311
391
|
.ft C
|
@@ -325,11 +405,21 @@ groonga\-munin\-pluginsパッケージをインストール:
|
|
325
405
|
.ft P
|
326
406
|
.fi
|
327
407
|
.sp
|
328
|
-
\fI\%
|
408
|
+
\fI\%MeCab\fP をトークナイザとして使いたいときは、groonga\-tokenizer\-mecabパッケージをインストールしてください。
|
409
|
+
.sp
|
410
|
+
groonga\-tokenizer\-mecabパッケージのインストール:
|
411
|
+
.sp
|
412
|
+
.nf
|
413
|
+
.ft C
|
414
|
+
% sudo yum install \-y groonga\-tokenizer\-mecab
|
415
|
+
.ft P
|
416
|
+
.fi
|
417
|
+
.sp
|
418
|
+
\fI\%Munin\fP プラグインを提供するパッケージもあります。Muninでgroongaの状態をモニターしたい場合は、groonga\-munin\-pluginsパッケージをインストールしてください。
|
329
419
|
.IP ノート
|
330
|
-
groonga\-munin\-pluginsパッケージはmunin\-nodeパッケージを必要としますが、munin\-nodeパッケージはCentOSの公式リポジトリには含まれていません。munin\-nodeパッケージをyumでインストールするために \fI\%RPMforge\fP リポジトリか \fI\%EPEL\fP リポジトリを有効にする必要があります。
|
420
|
+
groonga\-munin\-pluginsパッケージはmunin\-nodeパッケージを必要としますが、munin\-nodeパッケージはCentOSの公式リポジトリには含まれていません。munin\-nodeパッケージをyumでインストールするために \fI\%Repoforge (RPMforge)\fP リポジトリか \fI\%EPEL\fP リポジトリを有効にする必要があります。
|
331
421
|
.sp
|
332
|
-
i686環境でRPMforgeリポジトリを有効にする:
|
422
|
+
i686環境でRepoforge (RPMforge)リポジトリを有効にする:
|
333
423
|
.sp
|
334
424
|
.nf
|
335
425
|
.ft C
|
@@ -337,7 +427,7 @@ i686環境でRPMforgeリポジトリを有効にする:
|
|
337
427
|
.ft P
|
338
428
|
.fi
|
339
429
|
.sp
|
340
|
-
x86_64環境でRPMforgeリポジトリを有効にする:
|
430
|
+
x86_64環境でRepoforge (RPMforge)リポジトリを有効にする:
|
341
431
|
.sp
|
342
432
|
.nf
|
343
433
|
.ft C
|
@@ -354,7 +444,7 @@ EPELリポジトリを有効にする(環境非依存):
|
|
354
444
|
.fi
|
355
445
|
.RE
|
356
446
|
.sp
|
357
|
-
groonga\-munin\-plugins
|
447
|
+
groonga\-munin\-pluginsパッケージのインストール:
|
358
448
|
.sp
|
359
449
|
.nf
|
360
450
|
.ft C
|
@@ -374,9 +464,19 @@ groonga\-munin\-pluginsパッケージをインストール:
|
|
374
464
|
.ft P
|
375
465
|
.fi
|
376
466
|
.sp
|
377
|
-
\fI\%
|
467
|
+
\fI\%MeCab\fP をトークナイザとして使いたいときは、groonga\-tokenizer\-mecabパッケージをインストールしてください。
|
378
468
|
.sp
|
379
|
-
groonga\-
|
469
|
+
groonga\-tokenizer\-mecabパッケージのインストール:
|
470
|
+
.sp
|
471
|
+
.nf
|
472
|
+
.ft C
|
473
|
+
% sudo yum install \-y groonga\-tokenizer\-mecab
|
474
|
+
.ft P
|
475
|
+
.fi
|
476
|
+
.sp
|
477
|
+
\fI\%Munin\fP プラグインを提供するパッケージもあります。Muninでgroongaの状態をモニターしたい場合は、groonga\-munin\-pluginsパッケージをインストールしてください。
|
478
|
+
.sp
|
479
|
+
groonga\-munin\-pluginsパッケージのインストール:
|
380
480
|
.sp
|
381
481
|
.nf
|
382
482
|
.ft C
|
@@ -421,9 +521,9 @@ groonga\-munin\-pluginsパッケージをインストール:
|
|
421
521
|
.ft P
|
422
522
|
.fi
|
423
523
|
.sp
|
424
|
-
prefix
|
524
|
+
\fI\-\-prefix\fP オプションは、インストール先を指定するオプションです。明示的に指定しなければ、/usr/localが指定されたものとみなします。LD_LIBRARY_PATHなどに詳しくない人は、上記のように/usrを指定することをお勧めします。
|
425
525
|
.sp
|
426
|
-
groonga
|
526
|
+
groongaパッケージに含まれている \fI\%Munin\fP プラグインのインストールを有効にするには、 \fI\-\-with\-munin\-plugins\fP オプションを指定する必要があります。
|
427
527
|
.SH コミュニティ
|
428
528
|
.sp
|
429
529
|
groongaに関する情報を共有するための場所がいくつかあります。あなたの参加をお待ちしています!
|
@@ -432,10 +532,10 @@ groongaに関する情報を共有するための場所がいくつかありま
|
|
432
532
|
groongaに関する話題を扱うメーリングリストがあります。
|
433
533
|
.INDENT 0.0
|
434
534
|
.TP
|
435
|
-
.B For English
|
535
|
+
.B For English speakers
|
436
536
|
\fI\%groonga-talk@lists.sourceforge.net\fP
|
437
537
|
.TP
|
438
|
-
.B For Japanese
|
538
|
+
.B For Japanese speakers
|
439
539
|
\fI\%groonga-dev@lists.sourceforge.jp\fP
|
440
540
|
.UNINDENT
|
441
541
|
.SH チュートリアル
|
@@ -444,56 +544,58 @@ groongaに関する話題を扱うメーリングリストがあります。
|
|
444
544
|
groongaには、Cのライブラリとして使用する方法と、groonga実行ファイルを通して使用する方法があります。本チュートリアルでは、groonga実行ファイルを使用する方法について説明します。groonga実行ファイルを使って、データベースの作成・操作・サーバの起動・サーバへの接続などの操作が行えます。
|
445
545
|
.SS データベースの作成
|
446
546
|
.sp
|
447
|
-
|
547
|
+
groongaユーザへの第一歩はデータベースの作成です。まずは以下の書式をご覧ください。
|
448
548
|
.sp
|
449
549
|
書式:
|
450
550
|
.sp
|
451
551
|
.nf
|
452
552
|
.ft C
|
453
|
-
groonga \-n
|
553
|
+
groonga \-n DB_PATH
|
454
554
|
.ft P
|
455
555
|
.fi
|
456
556
|
.sp
|
457
|
-
\-n
|
557
|
+
\fI\-n\fP オプションは、データベースの作成を指示します。DB_PATHは、新しく作成するデータベースのパスを指定します。データベースは複数のファイルによって構成されるため、正確には、データベースの入り口となるファイルのパスとして使用されます。また、データベースを構成する他のファイルについては、DB_PATHがパスのプレフィックスとして使用されます。指定されたパスにファイルが存在しているときは失敗するので注意してください。
|
458
558
|
.sp
|
459
|
-
|
559
|
+
上記のコマンドは、データベースを作成してから、コマンドの入力を受け付ける対話モードに入ります。Ctrlキーを押しながらdキーを押すと、対話モードから抜けることができます。
|
460
560
|
.sp
|
461
561
|
実行例:
|
462
562
|
.sp
|
463
563
|
.nf
|
464
564
|
.ft C
|
465
|
-
% groonga \-n /tmp/
|
466
|
-
> Ctrl\-d
|
467
|
-
%
|
565
|
+
% groonga \-n /tmp/groonga\-databases/introduction.db
|
468
566
|
.ft P
|
469
567
|
.fi
|
568
|
+
.sp
|
569
|
+
データベースを作成に成功すれば、/tmp/groonga\-databases以下にデータベースを構成するファイルが配置されます。
|
470
570
|
.SS データベースの操作
|
471
571
|
.sp
|
572
|
+
以下の書式は、既存のデータベースを操作する方法を示しています。
|
573
|
+
.sp
|
472
574
|
書式:
|
473
575
|
.sp
|
474
576
|
.nf
|
475
577
|
.ft C
|
476
|
-
groonga
|
578
|
+
groonga DB_PATH [COMMAND]
|
477
579
|
.ft P
|
478
580
|
.fi
|
479
581
|
.sp
|
480
|
-
|
582
|
+
DB_PATHには操作対象のデータベースを指定します。指定したデータベースが存在しないときは失敗します。
|
481
583
|
.sp
|
482
584
|
COMMAND が指定された場合、COMMAND を実行した後、実行結果を返します。指定されなかった場合には、対話モードに入ります。対話モードでは、標準入力からコマンドを読み込み、順次実行します。本チュートリアルでは、対話モードを主に使用します。
|
483
585
|
.sp
|
484
|
-
それでは、status
|
586
|
+
それでは、 \fB/commands/status\fP コマンドを実行して、groongaの実行状態を確認してみましょう。
|
485
587
|
.sp
|
486
588
|
実行例:
|
487
589
|
.sp
|
488
590
|
.nf
|
489
591
|
.ft C
|
490
|
-
% groonga
|
592
|
+
% groonga /tmp/groonga\-databases/introduction.db
|
491
593
|
> status
|
492
|
-
[[0,
|
594
|
+
[[0,1332484898.47079,0.000113010406494141],{"alloc_count":151,"starttime":1332484898,"uptime":0,"version":"2.0.0\-250\-g5a3cf19","n_queries":0,"cache_hit_rate":0.0,"command_version":1,"default_command_version":1,"max_command_version":2}]
|
493
595
|
.ft P
|
494
596
|
.fi
|
495
597
|
.sp
|
496
|
-
以上のように、コマンドの実行結果は基本的にjson形式の配列として返却されます。配列の先頭には、エラーコードや実行時間などの情報が入ります。2
|
598
|
+
以上のように、コマンドの実行結果は基本的にjson形式の配列として返却されます。配列の先頭には、エラーコードや実行時間などの情報が入ります。2番目の要素には、指示された操作の実行結果が入ります。
|
497
599
|
.SS コマンドの書式
|
498
600
|
.sp
|
499
601
|
データベースを操作するコマンドには、以下の書式で引数を与えます。:
|
@@ -510,7 +612,7 @@ Form_2: COMMAND \-\-NAME_1 VALUE_1 \-\-NAME_2 VALUE_2 ..
|
|
510
612
|
.sp
|
511
613
|
書式2では値を名前と一緒に渡します。そのため、任意の順序で引数を指定することができます。このような引数は、名前付き引数やキーワード引数と呼ばれることもあります。
|
512
614
|
.sp
|
513
|
-
|
615
|
+
空白や特殊な記号(ダブルクォート、シングルクォート、および丸括弧)を含む値を指定したいときは、シングルクォート(\(aq)かダブルクォート(")で値を囲むようにしてください。
|
514
616
|
.sp
|
515
617
|
詳しくは、 \fB/executables/groonga\fP のコマンドの項を参考にしてください。
|
516
618
|
.SS 主なコマンド
|
@@ -547,18 +649,20 @@ groongaプロセスの状態を表示します。
|
|
547
649
|
.sp
|
548
650
|
groongaのテーブルには基本的に主キーが必要であり、テーブルを作成する際には型と格納方法も併せて指定する必要があります。
|
549
651
|
.sp
|
550
|
-
|
652
|
+
型には数値や文字列などがあります。ここではデータの種類を表しているものという程度に考えてください。詳細は \fB/type\fP に記述されています。主キーの格納方法は、主キーを条件とする検索にかかる時間や、前方一致検索の可否などを左右します。こちらも後で説明します。
|
551
653
|
.sp
|
552
|
-
|
654
|
+
それでは、テーブルを作成してみましょう。以下の例では、主キーのあるテーブルを作成します。 \fIname\fP 引数はテーブルの引数を指定します。 \fIflags\fP 引数は主キーの格納方法を指定するために使っています。 \fIkey_type\fP 引数は主キーの型を指定します。
|
553
655
|
.sp
|
554
656
|
実行例:
|
555
657
|
.sp
|
556
658
|
.nf
|
557
659
|
.ft C
|
558
660
|
> table_create \-\-name Site \-\-flags TABLE_HASH_KEY \-\-key_type ShortText
|
559
|
-
[[0,
|
661
|
+
[[0,1332484898.674,0.0103404521942139],true]
|
560
662
|
.ft P
|
561
663
|
.fi
|
664
|
+
.sp
|
665
|
+
実行結果の第2要素は、操作が成功したことを示しています。
|
562
666
|
.SS テーブルの表示
|
563
667
|
.sp
|
564
668
|
\fB/commands/select\fP コマンドを用いて、テーブルの中身を表示することができます。
|
@@ -568,245 +672,277 @@ groongaのテーブルには基本的に主キーが必要であり、テーブ
|
|
568
672
|
.nf
|
569
673
|
.ft C
|
570
674
|
> select \-\-table Site
|
571
|
-
[[0,
|
675
|
+
[[0,1332484898.88587,0.000526189804077148],[[[0],[["_id","UInt32"],["_key","ShortText"]]]]]
|
572
676
|
.ft P
|
573
677
|
.fi
|
574
678
|
.sp
|
575
|
-
selectにテーブル名のみを指定すると、指定したテーブルの中身を10件まで表示します。実行結果の[0]はテーブルに含まれるレコードの数を示しています。今回は何も登録されていないため0件です。レコード数の次に表示されている配列はテーブルの構成を示しています。["_id","Uint32"]はUInt32
|
679
|
+
\fB/commands/select\fP にテーブル名のみを指定すると、指定したテーブルの中身を10件まで表示します。実行結果の[0]はテーブルに含まれるレコードの数を示しています。今回は何も登録されていないため0件です。レコード数の次に表示されている配列はテーブルの構成を示しています。["_id","Uint32"]はUInt32型の値を持つ_idという名前のカラム、["_key","ShortText"]はShortText型の値を持つ_keyという名前のカラムをそれぞれ表しています。
|
576
680
|
.sp
|
577
|
-
table_create
|
681
|
+
\fB/commands/table_create\fP コマンドで作成したテーブルには、最初から_id, _keyという2つのカラムがあります。_idはgroongaが自動的に付与するID番号が格納されるカラムです。_keyは主キーが格納されるカラムです。これらのカラム名を変更することはできません。
|
578
682
|
.SS カラムの作成
|
579
683
|
.sp
|
580
684
|
\fB/commands/column_create\fP コマンドを用いて、カラムを作成することができます。
|
581
685
|
.sp
|
582
|
-
|
686
|
+
それでは、カラムを作成してみましょう。以下の例では、新しいカラムをSiteテーブルに追加します。 \fItable\fP 引数はテーブルの名前を指定します。 \fIname\fP 引数は新しいカラムの名前を指定します。 \fItype\fP 引数はカラムに格納する値の型を指定します。
|
583
687
|
.sp
|
584
688
|
実行例:
|
585
689
|
.sp
|
586
690
|
.nf
|
587
691
|
.ft C
|
588
|
-
> column_create \-\-table Site \-\-name title \-\-
|
589
|
-
[[0,
|
692
|
+
> column_create \-\-table Site \-\-name title \-\-type ShortText
|
693
|
+
[[0,1332484899.08879,0.00948214530944824],true]
|
590
694
|
> select \-\-table Site
|
591
|
-
[[0,
|
695
|
+
[[0,1332484899.29974,0.000299215316772461],[[[0],[["_id","UInt32"],["_key","ShortText"],["title","ShortText"]]]]]
|
592
696
|
.ft P
|
593
697
|
.fi
|
698
|
+
.SS データのロード
|
594
699
|
.sp
|
595
|
-
|
596
|
-
.SS 全文検索用の語彙表の作成
|
597
|
-
.sp
|
598
|
-
そろそろ全文検索の使い方について見ていきましょう。
|
599
|
-
.sp
|
600
|
-
groongaでは転置インデックスを使って高速な全文検索を実現しています。そのため、まずは転置インデックスとして用いるテーブルを作成する必要があります。テーブルの内容は、文書に含まれる単語やN\-gramなどの索引語を主キーとして、各カラムに索引語の位置情報を格納するという構成になります。結果として、主キーのカラムは全文検索における語彙表の役割を果たします。
|
700
|
+
\fB/commands/load\fP コマンドは、JSON形式のレコードを受け取り、テーブルに格納します。
|
601
701
|
.sp
|
602
|
-
|
702
|
+
以下の例では9つのレコードをSiteテーブルに格納します。
|
603
703
|
.sp
|
604
704
|
実行例:
|
605
705
|
.sp
|
606
706
|
.nf
|
607
707
|
.ft C
|
608
|
-
>
|
609
|
-
[
|
708
|
+
> load \-\-table Site
|
709
|
+
> [
|
710
|
+
> {"_key":"http://example.org/","title":"This is test record 1!"},
|
711
|
+
> {"_key":"http://example.net/","title":"test record 2."},
|
712
|
+
> {"_key":"http://example.com/","title":"test test record three."},
|
713
|
+
> {"_key":"http://example.net/afr","title":"test record four."},
|
714
|
+
> {"_key":"http://example.org/aba","title":"test test test record five."},
|
715
|
+
> {"_key":"http://example.com/rab","title":"test test test test record six."},
|
716
|
+
> {"_key":"http://example.net/atv","title":"test test test record seven."},
|
717
|
+
> {"_key":"http://example.org/gat","title":"test test record eight."},
|
718
|
+
> {"_key":"http://example.com/vdw","title":"test test record nine."},
|
719
|
+
> ]
|
720
|
+
[[0,1332484899.50234,2.20460820198059],9]
|
610
721
|
.ft P
|
611
722
|
.fi
|
612
723
|
.sp
|
613
|
-
|
614
|
-
.sp
|
615
|
-
実行例にあるTABLE_PAT_KEY|KEY_NORMALIZEという値は、主キー値をパトリシア木に格納することと、各索引語を正規化して登録することを示しています。また、default_tokenizerというパラメータには、検索の対象となる文書をトークナイズする方式を与えるようになっています。この例では、一般的にN\-gramと呼ばれるインデックス方式に対応するTokenBigramを指定しています。
|
616
|
-
.SS 全文検索用のインデックスカラムの作成
|
617
|
-
.sp
|
618
|
-
次に必要なのは、インデックス型のカラムを作成することです。このカラムは、関連付けられたカラムに対する全文検索に利用されます。つまり、全文検索を行いたいカラムに対してインデックスを作成することに相当します。
|
724
|
+
実行結果の第2要素はロードされたレコードの数を示しています。上記の操作では、すべてのレコードを問題なくロードできています。
|
619
725
|
.sp
|
620
|
-
|
726
|
+
念のため、データが入っていることを確認してみましょう。
|
621
727
|
.sp
|
622
728
|
実行例:
|
623
729
|
.sp
|
624
730
|
.nf
|
625
731
|
.ft C
|
626
|
-
>
|
627
|
-
[[0,
|
732
|
+
> select \-\-table Site
|
733
|
+
[[0,1332484901.90868,0.000381231307983398],[[[9],[["_id","UInt32"],["_key","ShortText"],["title","ShortText"]],[1,"http://example.org/","This is test record 1!"],[2,"http://example.net/","test record 2."],[3,"http://example.com/","test test record three."],[4,"http://example.net/afr","test record four."],[5,"http://example.org/aba","test test test record five."],[6,"http://example.com/rab","test test test test record six."],[7,"http://example.net/atv","test test test record seven."],[8,"http://example.org/gat","test test record eight."],[9,"http://example.com/vdw","test test record nine."]]]]
|
628
734
|
.ft P
|
629
735
|
.fi
|
736
|
+
.SS レコードの取得
|
630
737
|
.sp
|
631
|
-
|
632
|
-
.SS データのロード
|
738
|
+
\fB/commands/select\fP コマンドを用いて、テーブルの中身を表示することができます。
|
633
739
|
.sp
|
634
|
-
\fB/commands/
|
740
|
+
\fIquery\fP 引数を使って検索条件が指定された場合、 \fB/commands/select\fP コマンドは検索条件に適合するレコードを検索し、検索結果を出力します。
|
635
741
|
.sp
|
636
|
-
|
742
|
+
それでは、IDを指定してレコードを取り出してみましょう。以下の例では、Siteテーブルの先頭レコードを取り出します。正確には、 \fIquery\fP 引数を使って _id カラムに1が格納されているレコードを要求しています。
|
637
743
|
.sp
|
638
744
|
実行例:
|
639
745
|
.sp
|
640
746
|
.nf
|
641
747
|
.ft C
|
642
|
-
>
|
643
|
-
|
644
|
-
> {"_key":"http://example.org/","title":"This is test record 1!"},
|
645
|
-
> {"_key":"http://example.net/","title":"test record 2."},
|
646
|
-
> {"_key":"http://example.com/","title":"test test record three."},
|
647
|
-
> {"_key":"http://example.net/afr","title":"test record four."},
|
648
|
-
> {"_key":"http://example.org/aba","title":"test test test record five."},
|
649
|
-
> {"_key":"http://example.com/rab","title":"test test test test record six."},
|
650
|
-
> {"_key":"http://example.net/atv","title":"test test test record seven."},
|
651
|
-
> {"_key":"http://example.org/gat","title":"test test record eight."},
|
652
|
-
> {"_key":"http://example.com/vdw","title":"test test record nine."},
|
653
|
-
> ]
|
654
|
-
[[0,1317212714.08816,2.203527402],9]
|
748
|
+
> select \-\-table Site \-\-query _id:1
|
749
|
+
[[0,1332484902.11683,0.000809431076049805],[[[1],[["_id","UInt32"],["_key","ShortText"],["title","ShortText"]],[1,"http://example.org/","This is test record 1!"]]]]
|
655
750
|
.ft P
|
656
751
|
.fi
|
657
752
|
.sp
|
658
|
-
|
753
|
+
次に、主キーを指定してレコードを取り出してみましょう。以下の例では、主キーが "\fI\%http://example.org/\fP" のキーを取り出します。正確には、 \fIquery\fP 引数を使って _key カラムに "\fI\%http://example.org/\fP" が格納されているレコードを要求しています。
|
659
754
|
.sp
|
660
755
|
実行例:
|
661
756
|
.sp
|
662
757
|
.nf
|
663
758
|
.ft C
|
664
|
-
> select \-\-table Site
|
665
|
-
[[0,
|
759
|
+
> select \-\-table Site \-\-query \(aq_key:"http://example.org/"\(aq
|
760
|
+
[[0,1332484902.32106,0.000850200653076172],[[[1],[["_id","UInt32"],["_key","ShortText"],["title","ShortText"]],[1,"http://example.org/","This is test record 1!"]]]]
|
666
761
|
.ft P
|
667
762
|
.fi
|
668
|
-
.SS
|
763
|
+
.SS 全文検索用の語彙表の作成
|
764
|
+
.sp
|
765
|
+
そろそろ全文検索の使い方について見ていきましょう。
|
669
766
|
.sp
|
670
|
-
|
767
|
+
groongaでは転置インデックスを使って高速な全文検索を実現しています。そのため、まずは転置インデックスとして用いるテーブルを作成する必要があります。テーブルの内容は、文書に含まれる単語やN\-gramなどの索引語を主キーとして、各カラムに索引語の位置情報を格納するという構成になります。結果として、主キーのカラムは全文検索における語彙表の役割を果たします。
|
671
768
|
.sp
|
672
|
-
|
769
|
+
以下の例では、Termsという名前のテーブルを転置インデックスの語彙表として作成しています。索引語を格納するため、主キーの型はShortTextです。
|
673
770
|
.sp
|
674
771
|
実行例:
|
675
772
|
.sp
|
676
773
|
.nf
|
677
774
|
.ft C
|
678
|
-
>
|
679
|
-
[[0,
|
775
|
+
> table_create \-\-name Terms \-\-flags TABLE_PAT_KEY|KEY_NORMALIZE \-\-key_type ShortText \-\-default_tokenizer TokenBigram
|
776
|
+
[[0,1332484902.52532,0.00777173042297363],true]
|
680
777
|
.ft P
|
681
778
|
.fi
|
682
779
|
.sp
|
683
|
-
|
780
|
+
\fB/commands/table_create\fP には多くの引数が指定されているものの、本チュートリアルではすべてを理解する必要はありません。以下に簡単な説明を述べますが、読み飛ばしてもらってかまいません。
|
684
781
|
.sp
|
685
|
-
|
782
|
+
TABLE_PAT_KEYフラグは、主キーをパトリシア木に格納することを指示しています。KEY_NORMALIZEフラグは、索引語を正規化して登録することを指示しています。 \fIdefault_tokenizer\fP 引数には、検索対象の文書をトークナイズする方式を指定するようになっています。上記の例では、一般的にN\-gramと呼ばれるインデックス方式に対応するTokenBigramを指定しています。
|
783
|
+
.SS 全文検索用のインデックスカラムの作成
|
784
|
+
.sp
|
785
|
+
次に必要なのは、インデックス型のカラムを作成することです。このカラムは、関連付けられたカラムに対する全文検索に利用されます。つまり、全文検索を行いたいカラムに対してインデックスを作成することに相当します。
|
786
|
+
.sp
|
787
|
+
それでは、インデックスカラムを作成してみましょう。以下の例では、Siteテーブルのカラムに対するインデックスカラムを作成します。それでは、Siteテーブルのtitleカラムを全文検索の対象とするべく、インデックス型のカラムを作成してみましょう。
|
686
788
|
.sp
|
687
789
|
実行例:
|
688
790
|
.sp
|
689
791
|
.nf
|
690
792
|
.ft C
|
691
|
-
>
|
692
|
-
[[0,
|
793
|
+
> column_create \-\-table Terms \-\-name blog_title \-\-flags COLUMN_INDEX|WITH_POSITION \-\-type Site \-\-source title
|
794
|
+
[[0,1332484902.73511,0.0202178955078125],true]
|
693
795
|
.ft P
|
694
796
|
.fi
|
695
797
|
.sp
|
696
|
-
|
798
|
+
\fItable\fP 引数は語彙表を指定し、 \fIname\fP 引数はインデックスカラムを指定します。また、 \fItype\fP 引数はインデックスの対象となるテーブルを指定し、 \fIsource\fP 引数はインデックスの対象となるカラムを指定します。COLUMN_INDEXフラグはインデックスカラムの作成を指示し、WITH_POSITIONフラグは各索引語の位置情報をインデックスに含めることを指示します。一般的な全文検索インデックスを作成したいときは、COLUMN_INDEX|WITH_POSITIONを指定してください。索引語の位置情報については、本チュートリアルでは触れません。
|
799
|
+
.IP ノート
|
800
|
+
語彙表とインデックスカラムを作成するタイミングは、データをロードする前後のどちらでも問題ありません。データをロードした後でインデックスを作成し、さらに新しいデータをロードすることもできます。インデックスの作成を指示したタイミングでレコードが既に存在するときは、静的にインデックスを作成します。一方、インデックスを作成した後で追加されたレコードについては、動的にインデックスを更新します。
|
801
|
+
.RE
|
697
802
|
.SS 全文検索
|
698
803
|
.sp
|
699
|
-
|
804
|
+
インデックスを作成したことにより、 \fB/commands/select\fP コマンドによる全文検索が可能になります。
|
805
|
+
.sp
|
806
|
+
全文検索のクエリは \fIquery\fP 引数により指定することができます。以下の例では、titleカラムに "this" という文字列が含まれているレコードを検索します。 \fIquery\fP 引数に含まれる \(aq@\(aq は、全文検索を指示しています。語彙表の作成において KEY_NORMALIZE フラグを指定したときは、全角・半角や大文字・小文字などの違いが吸収されることに注意してください。
|
700
807
|
.sp
|
701
808
|
実行例:
|
702
809
|
.sp
|
703
810
|
.nf
|
704
811
|
.ft C
|
705
812
|
> select \-\-table Site \-\-query title:@this
|
706
|
-
[[0,
|
813
|
+
[[0,1332484902.95678,0.000878334045410156],[[[1],[["_id","UInt32"],["_key","ShortText"],["title","ShortText"]],[1,"http://example.org/","This is test record 1!"]]]]
|
707
814
|
.ft P
|
708
815
|
.fi
|
709
816
|
.sp
|
710
|
-
|
817
|
+
上記の例では、"This" という単語を含む先頭レコードのみが検索条件に適合します。
|
711
818
|
.sp
|
712
|
-
selectコマンドには、
|
819
|
+
\fB/commands/select\fP コマンドには、 \fImatch_columns\fP という引数が存在します。このパラメータはデフォルトで検索対象にするカラムを指定するもので、カラム名を指定しない検索条件にのみ適用されます。 [1]
|
713
820
|
.sp
|
714
|
-
match_columns
|
821
|
+
"\fI\-\-match_columns\fP title" と "\fI\-\-query\fP this" の組み合わせを指定すると、 "\fI\-\-query\fP title:@this" を指定したときと同じ検索条件になります。
|
715
822
|
.sp
|
716
823
|
実行例:
|
717
824
|
.sp
|
718
825
|
.nf
|
719
826
|
.ft C
|
720
827
|
> select \-\-table Site \-\-match_columns title \-\-query this
|
721
|
-
[[0,
|
828
|
+
[[0,1332484903.16096,0.000757932662963867],[[[1],[["_id","UInt32"],["_key","ShortText"],["title","ShortText"]],[1,"http://example.org/","This is test record 1!"]]]]
|
722
829
|
.ft P
|
723
830
|
.fi
|
724
831
|
.SS 出力カラムの指定
|
725
832
|
.sp
|
726
|
-
select
|
833
|
+
\fB/commands/select\fP コマンドにおいて \fIoutput_columns\fP 引数を用いることで、検索結果に含めるカラムを指定することができます。複数のカラムを指定するときは、カンマ(,)区切りでカラムを列挙します。
|
727
834
|
.sp
|
728
835
|
実行例:
|
729
836
|
.sp
|
730
837
|
.nf
|
731
838
|
.ft C
|
732
839
|
> select \-\-table Site \-\-output_columns _key,title,_score \-\-query title:@test
|
733
|
-
[[0,
|
840
|
+
[[0,1332484903.36506,0.000709056854248047],[[[9],[["_key","ShortText"],["title","ShortText"],["_score","Int32"]],["http://example.org/","This is test record 1!",1],["http://example.net/","test record 2.",1],["http://example.com/","test test record three.",2],["http://example.net/afr","test record four.",1],["http://example.org/aba","test test test record five.",3],["http://example.com/rab","test test test test record six.",4],["http://example.net/atv","test test test record seven.",3],["http://example.org/gat","test test record eight.",2],["http://example.com/vdw","test test record nine.",2]]]]
|
734
841
|
.ft P
|
735
842
|
.fi
|
736
843
|
.sp
|
737
|
-
|
844
|
+
上記の例では、_scoreカラムを含む3つのカラムを指定しています。_scoreカラムはgroongaの検索結果に含まれるカラムであり、全文検索の条件に合致するレコードほど高い数値が入ります。
|
738
845
|
.SS 表示範囲指定
|
739
846
|
.sp
|
740
|
-
select
|
847
|
+
\fB/commands/select\fP コマンドにおいて \fIoffset\fP 引数と \fIlimit\fP 引数を用いることで、検索結果の一部のみを表示することができます。大量の検索結果を分割してページ単位で表示したい場合などに有用です。
|
741
848
|
.sp
|
742
|
-
|
849
|
+
\fIoffset\fP 引数には、検索結果における始点を指定します。検索結果の1件目が必要な場合、 \fIoffset\fP 引数を省略するか、0を指定するようにしてください。 \fIlimit\fP 引数には、検索結果の表示件数を指定します。
|
743
850
|
.sp
|
744
851
|
実行例:
|
745
852
|
.sp
|
746
853
|
.nf
|
747
854
|
.ft C
|
748
855
|
> select \-\-table Site \-\-offset 0 \-\-limit 3
|
749
|
-
[[0,
|
856
|
+
[[0,1332484903.57505,0.000303268432617188],[[[9],[["_id","UInt32"],["_key","ShortText"],["title","ShortText"]],[1,"http://example.org/","This is test record 1!"],[2,"http://example.net/","test record 2."],[3,"http://example.com/","test test record three."]]]]
|
750
857
|
> select \-\-table Site \-\-offset 3 \-\-limit 3
|
751
|
-
[[0,
|
858
|
+
[[0,1332484903.77936,0.000320196151733398],[[[9],[["_id","UInt32"],["_key","ShortText"],["title","ShortText"]],[4,"http://example.net/afr","test record four."],[5,"http://example.org/aba","test test test record five."],[6,"http://example.com/rab","test test test test record six."]]]]
|
752
859
|
> select \-\-table Site \-\-offset 7 \-\-limit 3
|
753
|
-
[[0,
|
860
|
+
[[0,1332484903.98409,0.000294685363769531],[[[9],[["_id","UInt32"],["_key","ShortText"],["title","ShortText"]],[8,"http://example.org/gat","test test record eight."],[9,"http://example.com/vdw","test test record nine."]]]]
|
754
861
|
.ft P
|
755
862
|
.fi
|
756
|
-
.SS
|
863
|
+
.SS 検索結果の並べ替え
|
757
864
|
.sp
|
758
|
-
select
|
865
|
+
\fB/commands/select\fP コマンドに \fIsortby\fP 引数を渡すことにより、検索結果を並べ替えることができます。
|
759
866
|
.sp
|
760
|
-
|
867
|
+
\fIsortby\fP 引数には、整列の基準として用いるカラムを指定します。検索結果は指定したカラムの値が昇順になるように並べ替えられます。 \fIsortby\fP 引数の中でカラム名の前にハイフン(\-)を付けることにより、降順に並べ替えることもできます。
|
868
|
+
.sp
|
869
|
+
以下の例では、Siteテーブルのレコードを逆順に表示しています。
|
761
870
|
.sp
|
762
871
|
実行例:
|
763
872
|
.sp
|
764
873
|
.nf
|
765
874
|
.ft C
|
766
875
|
> select \-\-table Site \-\-sortby \-_id
|
767
|
-
[[0,
|
876
|
+
[[0,1332484904.18805,0.000293493270874023],[[[9],[["_id","UInt32"],["_key","ShortText"],["title","ShortText"]],[9,"http://example.com/vdw","test test record nine."],[8,"http://example.org/gat","test test record eight."],[7,"http://example.net/atv","test test test record seven."],[6,"http://example.com/rab","test test test test record six."],[5,"http://example.org/aba","test test test record five."],[4,"http://example.net/afr","test record four."],[3,"http://example.com/","test test record three."],[2,"http://example.net/","test record 2."],[1,"http://example.org/","This is test record 1!"]]]]
|
768
877
|
.ft P
|
769
878
|
.fi
|
770
879
|
.sp
|
771
|
-
|
880
|
+
次の例では、_scoreカラムを整列の基準とすることにより、検索結果のランキングをおこなっています。検索結果はクエリとの関連性が高い順に並べ替えられます。
|
772
881
|
.sp
|
773
882
|
実行例:
|
774
883
|
.sp
|
775
884
|
.nf
|
776
885
|
.ft C
|
777
|
-
> select \-\-table Site \-\-query title:@test \-\-output_columns _id,_score,title \-\-sortby _score
|
778
|
-
[[0,
|
886
|
+
> select \-\-table Site \-\-query title:@test \-\-output_columns _id,_score,title \-\-sortby \-_score
|
887
|
+
[[0,1332484904.39402,0.000802755355834961],[[[9],[["_id","UInt32"],["_score","Int32"],["title","ShortText"]],[6,4,"test test test test record six."],[5,3,"test test test record five."],[7,3,"test test test record seven."],[8,2,"test test record eight."],[3,2,"test test record three."],[9,2,"test test record nine."],[1,1,"This is test record 1!"],[4,1,"test record four."],[2,1,"test record 2."]]]]
|
779
888
|
.ft P
|
780
889
|
.fi
|
781
890
|
.sp
|
782
|
-
|
891
|
+
整列の基準となるカラムを複数指定したいときは、カンマ(,)区切りでカラムを列挙します。複数のカラムを指定したときは、最初のカラムを基準として整列した後、最初のカラムに同じ値が格納されているレコードを次のカラムを基準として整列します。
|
783
892
|
.sp
|
784
893
|
実行例:
|
785
894
|
.sp
|
786
895
|
.nf
|
787
896
|
.ft C
|
788
|
-
> select \-\-table Site \-\-query title:@test \-\-output_columns _id,_score,title \-\-sortby _score,_id
|
789
|
-
[[0,
|
897
|
+
> select \-\-table Site \-\-query title:@test \-\-output_columns _id,_score,title \-\-sortby \-_score,_id
|
898
|
+
[[0,1332484904.60132,0.000498056411743164],[[[9],[["_id","UInt32"],["_score","Int32"],["title","ShortText"]],[6,4,"test test test test record six."],[5,3,"test test test record five."],[7,3,"test test test record seven."],[3,2,"test test record three."],[8,2,"test test record eight."],[9,2,"test test record nine."],[1,1,"This is test record 1!"],[2,1,"test record 2."],[4,1,"test record four."]]]]
|
790
899
|
.ft P
|
791
900
|
.fi
|
792
901
|
脚注
|
793
902
|
.IP [1] 5
|
794
|
-
現在のバージョンでは、全文検索インデックスが存在する場合にのみ、
|
795
|
-
.SS
|
903
|
+
現在のバージョンでは、全文検索インデックスが存在する場合にのみ、 \fImatch_columns\fP 引数を利用することができます。通常のカラムでの絞り込みには利用できません。
|
904
|
+
.SS リモートアクセス
|
905
|
+
.sp
|
906
|
+
groongaをサーバとして起動することにより、ネットワークを介してデータベースにアクセスできるようになります。groongaがサポートしているプロトコルは、groongaの専用プロトコルであるgqtp、memcachedバイナリプロトコル、HTTPの三種類です。
|
907
|
+
.SS groonga専用プロトコル(gqtp)
|
908
|
+
.SS gqtpサーバの起動
|
796
909
|
.sp
|
797
|
-
groonga
|
798
|
-
.SS groonga専用プロトコルによる通信
|
799
|
-
.SS groongaデーモンの起動
|
910
|
+
groongaには、専用のプロトコルであるgqtpが存在します。gqtpを用いることにより、データベースへとリモートアクセスすることができます。以下の書式はgqtpサーバの起動方法を示しています。
|
800
911
|
.sp
|
801
912
|
書式:
|
802
913
|
.sp
|
803
914
|
.nf
|
804
915
|
.ft C
|
805
|
-
groonga [\-p PORT_NUMBER] \-
|
916
|
+
groonga [\-p PORT_NUMBER] \-s DB_PATH
|
806
917
|
.ft P
|
807
918
|
.fi
|
808
919
|
.sp
|
809
|
-
|
920
|
+
\fI\-s\fP オプションはgroongaをサーバとして起動するためのオプションです。DB_PATHには既存のデータベースのパスを指定します。 \fI\-p\fP オプションとその引数により、サーバのポート番号を指定することができます。ポート番号を省略した場合は10041が使用されます。
|
921
|
+
.sp
|
922
|
+
以下のコマンドにより、デフォルトのポート番号で待ち受けるサーバを起動することができます。サーバは指定されたデータベースへの操作を受け付けます。
|
923
|
+
.sp
|
924
|
+
実行例:
|
925
|
+
.sp
|
926
|
+
.nf
|
927
|
+
.ft C
|
928
|
+
% groonga \-s /tmp/groonga\-databases/introduction.db
|
929
|
+
Ctrl\-c
|
930
|
+
%
|
931
|
+
.ft P
|
932
|
+
.fi
|
933
|
+
.SS gqtpデーモンの起動
|
934
|
+
.sp
|
935
|
+
gqtpサーバはデーモンとして起動することができます。オプションとして、 \fI\-s\fP の代わりに \fI\-d\fP を与えてください。
|
936
|
+
.sp
|
937
|
+
書式:
|
938
|
+
.sp
|
939
|
+
.nf
|
940
|
+
.ft C
|
941
|
+
groonga [\-p PORT_NUMBER] \-d DB_PATH
|
942
|
+
.ft P
|
943
|
+
.fi
|
944
|
+
.sp
|
945
|
+
groongaをデーモンとして起動したときは、デーモンのプロセスIDが表示されます。以下の例では、12345というプロセスIDが表示されています。サーバとして起動した場合と同様に、指定されたデータベースへの操作を受け付けます。
|
810
946
|
.sp
|
811
947
|
実行例:
|
812
948
|
.sp
|
@@ -817,9 +953,9 @@ groonga [\-p PORT_NUMBER] \-d DB_PATH_NAME
|
|
817
953
|
%
|
818
954
|
.ft P
|
819
955
|
.fi
|
956
|
+
.SS gqtpサーバへの接続
|
820
957
|
.sp
|
821
|
-
|
822
|
-
.SS groongaサーバへの接続
|
958
|
+
gtqpサーバに接続するクライアントは、以下のように起動します。
|
823
959
|
.sp
|
824
960
|
書式:
|
825
961
|
.sp
|
@@ -829,11 +965,7 @@ groonga [\-p PORT_NUMBER] \-c [HOST_NAME_OR_IP_ADDRESS]
|
|
829
965
|
.ft P
|
830
966
|
.fi
|
831
967
|
.sp
|
832
|
-
|
833
|
-
.sp
|
834
|
-
対象ホスト名を省略した場合はlocalhostに対して接続し、対象ポート番号を省略した場合は10041ポートに対して接続します。
|
835
|
-
.sp
|
836
|
-
接続に成功すると対話モードに入り、標準入力からコマンドを読み込んで順次実行します。
|
968
|
+
上記のコマンドによって起動されたクライアントは、サーバとの接続に成功すると対話モードに入ります。HOST_NAME_OR_IP_ADDRESSにはサーバのホスト名もしくはIPアドレスを指定します。HOST_NAME_OR_IP_ADDRESSが省略されたときは"localhost"をサーバのホスト名として採用します。また、 \fI\-p\fP オプションとその引数により、サーバのポート番号を指定することができます。ポート番号を省略した場合は10041が使用されます。
|
837
969
|
.sp
|
838
970
|
実行例:
|
839
971
|
.sp
|
@@ -841,14 +973,16 @@ groonga [\-p PORT_NUMBER] \-c [HOST_NAME_OR_IP_ADDRESS]
|
|
841
973
|
.ft C
|
842
974
|
% groonga \-c
|
843
975
|
> status
|
844
|
-
[[0,
|
976
|
+
[[0,1332486613.4953,9.918212890625e\-05],{"alloc_count":130,"starttime":1332486613,"uptime":0,"version":"2.0.0\-250\-g5a3cf19","n_queries":0,"cache_hit_rate":0.0,"command_version":1,"default_command_version":1,"max_command_version":2}]
|
845
977
|
> ctrl\-d
|
846
978
|
%
|
847
979
|
.ft P
|
848
980
|
.fi
|
849
|
-
.SS groongaデーモンの終了
|
850
981
|
.sp
|
851
|
-
|
982
|
+
対話モードでは、標準入力からコマンドを読み込んで順次実行します。
|
983
|
+
.SS gqtpサーバの終了
|
984
|
+
.sp
|
985
|
+
gqtpサーバを終了する安全は方法は、クライアントを起動して \fB/commands/shutdown\fP を発行することです。
|
852
986
|
.sp
|
853
987
|
実行例:
|
854
988
|
.sp
|
@@ -859,128 +993,256 @@ groongaデーモンにshutdownコマンドを発行することにより、終
|
|
859
993
|
%
|
860
994
|
.ft P
|
861
995
|
.fi
|
862
|
-
.SS
|
996
|
+
.SS memcachedバイナリプロトコル
|
863
997
|
.sp
|
864
|
-
groonga
|
998
|
+
groongaはmemcachedバイナリプロトコルをサポートしています。以下の書式はmemcachedバイナリプロトコルのサーバをデーモンとして起動する方法を示しています。
|
865
999
|
.sp
|
866
1000
|
書式:
|
867
1001
|
.sp
|
868
1002
|
.nf
|
869
1003
|
.ft C
|
870
|
-
groonga [\-p PORT_NUMBER] \-d \-\-protocol
|
1004
|
+
groonga [\-p PORT_NUMBER] \-d \-\-protocol memcached DB_PATH
|
871
1005
|
.ft P
|
872
1006
|
.fi
|
873
1007
|
.sp
|
874
|
-
protocol
|
875
|
-
.SS
|
1008
|
+
\fI\-\-protocol\fP オプションとその引数により、サーバのプロトコルを指定することができます。"memcached"はmemcachedバイナリプロトコルを示しています。
|
1009
|
+
.SS HTTP
|
1010
|
+
.SS HTTPサーバの起動
|
1011
|
+
.sp
|
1012
|
+
groongaはHTTPをサポートしています。以下の書式はHTTPサーバをデーモンとして起動する方法を示しています。
|
876
1013
|
.sp
|
877
|
-
|
878
|
-
.
|
1014
|
+
書式:
|
1015
|
+
.sp
|
1016
|
+
.nf
|
1017
|
+
.ft C
|
1018
|
+
groonga [\-p PORT_NUMBER] \-d \-\-protocol http DB_PATH
|
1019
|
+
.ft P
|
1020
|
+
.fi
|
879
1021
|
.sp
|
880
|
-
|
1022
|
+
\fI\-\-protocol\fP オプションとその引数により、サーバのプロトコルを指定することができます。"http"はHTTPサーバの起動を指示しています。
|
881
1023
|
.sp
|
882
|
-
|
1024
|
+
以下のコマンドは、ポート番号80で待ち受けるHTTPサーバをデーモンとして起動します。
|
883
1025
|
.sp
|
884
1026
|
実行例:
|
885
1027
|
.sp
|
886
1028
|
.nf
|
887
1029
|
.ft C
|
888
|
-
http
|
889
|
-
|
1030
|
+
% groonga \-p 80 \-d \-\-protocol http /tmp/groonga\-databases/introduction.db
|
1031
|
+
%
|
1032
|
+
.ft P
|
1033
|
+
.fi
|
1034
|
+
.SS HTTPサーバへのコマンド送信
|
1035
|
+
.sp
|
1036
|
+
groongaがHTTPサーバとして起動されているときは、/d/COMMAND_NAME というURLにアクセスすることにより、コマンドを実行することができます。コマンドの引数は、HTTPのGETパラメータとして渡します。引数の書式は "?NAME_1=VALUE_1&NAME_2=VALUE_2&..." となります。
|
1037
|
+
.sp
|
1038
|
+
以下の例は、HTTPサーバに対するコマンドの送り方を示しています。
|
1039
|
+
.sp
|
1040
|
+
実行例:
|
1041
|
+
.sp
|
1042
|
+
.nf
|
1043
|
+
.ft C
|
1044
|
+
http://HOST_NAME_OR_IP_ADDRESS[:PORT_NUMBER]/d/status
|
1045
|
+
Executed command:
|
890
1046
|
> status
|
891
|
-
[[0,
|
1047
|
+
[[0,1332486613.69917,0.000123739242553711],{"alloc_count":131,"starttime":1332486613,"uptime":0,"version":"2.0.0\-250\-g5a3cf19","n_queries":0,"cache_hit_rate":0.0,"command_version":1,"default_command_version":1,"max_command_version":2}]
|
892
1048
|
|
893
|
-
http://[
|
894
|
-
|
1049
|
+
http://HOST_NAME_OR_IP_ADDRESS[:PORT_NUMBER]/d/select?table=Site&query=title:@this
|
1050
|
+
Executed command:
|
895
1051
|
> select \-\-table Site \-\-query title:@this
|
896
|
-
[[0,
|
1052
|
+
[[0,1332486613.90319,0.00245404243469238],[[[1],[["_id","UInt32"],["_key","ShortText"],["title","ShortText"]],[1,"http://example.org/","This is test record 1!"]]]]
|
897
1053
|
.ft P
|
898
1054
|
.fi
|
1055
|
+
.SS ブラウザベースの管理ツール
|
1056
|
+
.sp
|
1057
|
+
groongaをHTTPサーバとして起動しているときは、ブラウザベースの管理ツールを使うことにより、データベースを簡単に管理することができます。管理ツールを使いたいときは、ブラウザを使って \fI\%http://HOST_NAME_OR_IP_ADDRESS[:PORT_NUMBER]/\fP へとアクセスしてください。管理ツールの使用には、JavaScriptの実行が有効になっている必要があります。
|
899
1058
|
.SS セキュリティ
|
900
1059
|
.sp
|
901
|
-
groonga
|
902
|
-
.SS
|
1060
|
+
groongaのサーバには認証機能がありません。誰でもデータベースの内容を閲覧・修正することができます。iptablesなどを用いてアクセス元IPアドレスを制限することを推奨します。
|
1061
|
+
.SS いろいろなデータの保存
|
903
1062
|
.sp
|
904
|
-
groonga
|
905
|
-
.SS
|
1063
|
+
groongaは全文検索エンジンを起源として独自のカラムストアを持つに至るわけですが、索引語や文書を保存するだけでなく、数値や文字列、日時や経緯度など、いろいろなデータを保存することができます。本チュートリアルでは、groongaで保存できるデータの種類、およびに保存の方法を説明します。
|
1064
|
+
.SS データの種類
|
1065
|
+
.sp
|
1066
|
+
groongaにおいて利用できる基本型は、真偽値、数値、文字列、日時、経緯度の5種類に大別できます。基本型において、数値は整数・浮動小数点数の違い、符号の有無と割り当てるビット数によって細分化できるほか、文字列は長さの上限によって細分化できます。また、経緯度には測地系による分類があります。詳しくは \fB/type\fP を参照してください。
|
1067
|
+
.sp
|
1068
|
+
拡張型としては、別テーブルを参照するための情報であるテーブル参照を保存することができます。また、基本型もしくはテーブル参照を複数まとめて保存できるように、ベクターカラムをサポートしています。
|
1069
|
+
.sp
|
1070
|
+
それでは、本チュートリアルで使用するテーブルを作成しておきましょう。
|
1071
|
+
.sp
|
1072
|
+
実行例:
|
1073
|
+
.sp
|
1074
|
+
.nf
|
1075
|
+
.ft C
|
1076
|
+
> table_create \-\-name ToyBox \-\-flags TABLE_HASH_KEY \-\-key_type ShortText
|
1077
|
+
[[0,1332498286.03578,0.00542259216308594],true]
|
1078
|
+
.ft P
|
1079
|
+
.fi
|
1080
|
+
.SS 真偽値
|
1081
|
+
.sp
|
1082
|
+
ブール型は真偽値(true/false)を表現するための型です。ブール型のカラムを作成するには、 \fB/commands/column_create\fP コマンドの \fItype\fP 引数に Bool を指定します。ブール型のデフォルト値はfalseです。
|
1083
|
+
.sp
|
1084
|
+
以下の例では、ブール型のカラムを作成し、3つのレコードを追加します。3番目のレコードについては、値を省略しているため、デフォルト値が格納されます。
|
1085
|
+
.sp
|
1086
|
+
実行例:
|
1087
|
+
.sp
|
1088
|
+
.nf
|
1089
|
+
.ft C
|
1090
|
+
> column_create \-\-table ToyBox \-\-name is_animal \-\-type Bool
|
1091
|
+
[[0,1332498286.2427,0.00578594207763672],true]
|
1092
|
+
> load \-\-table ToyBox
|
1093
|
+
> [
|
1094
|
+
> {"_key":"Monkey","is_animal":true}
|
1095
|
+
> {"_key":"Flower","is_animal":false}
|
1096
|
+
> {"_key":"Block"}
|
1097
|
+
> ]
|
1098
|
+
[[0,1332498286.44978,1.00197458267212],3]
|
1099
|
+
> select \-\-table ToyBox \-\-output_columns _key,is_animal
|
1100
|
+
[[0,1332498287.65257,0.000472545623779297],[[[3],[["_key","ShortText"],["is_animal","Bool"]],["Monkey",true],["Flower",false],["Block",false]]]]
|
1101
|
+
.ft P
|
1102
|
+
.fi
|
1103
|
+
.SS 数値
|
1104
|
+
.sp
|
1105
|
+
数値型は、整数と浮動小数点数に分けることができます。整数は、符号付き整数と符号なし整数に分けることができるだけでなく、割り当てるビット数によっても分けることができます。割り当てるビット数を大きくすると、カラムのサイズは大きくなってしまいますが、表現できる整数の範囲を大きくすることができます。詳しくは \fB/type\fP を参照してください。数値型のデフォルト値はいずれも0です。
|
906
1106
|
.sp
|
907
|
-
|
1107
|
+
以下の例では、Int8型のカラムとFloat型のカラムを作成し、既存のレコードを更新します。weightカラムについては、指定した値が問題なく格納されています。一方、priceカラムに指定した小数については、小数点以下を切り捨てた値が格納されています。また、表現できる範囲を超える値を格納しようとした2番目のレコードについては、指定した値とは異なる値が格納されています。このように、表現できる範囲を超える値を指定すると、操作後の値は未定義になるので注意してください。
|
908
1108
|
.sp
|
909
|
-
|
1109
|
+
実行例:
|
1110
|
+
.sp
|
1111
|
+
.nf
|
1112
|
+
.ft C
|
1113
|
+
> column_create \-\-table ToyBox \-\-name price \-\-type Int8
|
1114
|
+
[[0,1332498287.85609,0.00574946403503418],true]
|
1115
|
+
> column_create \-\-table ToyBox \-\-name weight \-\-type Float
|
1116
|
+
[[0,1332498288.06304,0.00493621826171875],true]
|
1117
|
+
> load \-\-table ToyBox
|
1118
|
+
> [
|
1119
|
+
> {"_key":"Monkey","price":15.9}
|
1120
|
+
> {"_key":"Flower","price":200,"weight":0.13}
|
1121
|
+
> {"_key":"Block","weight":25.7}
|
1122
|
+
> ]
|
1123
|
+
[[0,1332498288.26924,1.00213837623596],3]
|
1124
|
+
> select \-\-table ToyBox \-\-output_columns _key,price,weight
|
1125
|
+
[[0,1332498289.47254,0.000308036804199219],[[[3],[["_key","ShortText"],["price","Int8"],["weight","Float"]],["Monkey",15,0.0],["Flower",\-56,0.13],["Block",0,25.7]]]]
|
1126
|
+
.ft P
|
1127
|
+
.fi
|
1128
|
+
.SS 文字列
|
1129
|
+
.sp
|
1130
|
+
文字列型は、長さの上限によって分けることができます。詳しくは \fB/type\fP を参照してください。文字列型のデフォルト値は長さ0の文字列です。
|
910
1131
|
.sp
|
911
|
-
|
1132
|
+
以下の例では、ShortText型のカラムを作成し、IDが1と2のレコードを更新します。更新しないレコードについては、デフォルト値のままとなります。
|
912
1133
|
.sp
|
913
1134
|
実行例:
|
914
1135
|
.sp
|
915
1136
|
.nf
|
916
1137
|
.ft C
|
917
|
-
>
|
918
|
-
[[0,
|
919
|
-
>
|
920
|
-
[
|
921
|
-
>
|
922
|
-
|
923
|
-
>
|
924
|
-
[[0,
|
925
|
-
>
|
926
|
-
[[0,
|
927
|
-
> load \-\-table Type
|
928
|
-
> [{"_key":"sample","number":12345,"float":42.195,"string":"GROONGA","time":1234567890.12}]
|
929
|
-
[[0,1322616294.77086,0.202357708],1]
|
930
|
-
> select \-\-table Type
|
931
|
-
[[0,1322616295.1744,0.000340057],[[[1],[["_id","UInt32"],["_key","ShortText"],["float","Float"],["number","Int32"],["string","ShortText"],["time","Time"]],[1,"sample",42.195,12345,"GROONGA",1234567890.12]]]]
|
1138
|
+
> column_create \-\-table ToyBox \-\-name name \-\-type ShortText
|
1139
|
+
[[0,1332498289.67627,0.00676369667053223],true]
|
1140
|
+
> load \-\-table ToyBox
|
1141
|
+
> [
|
1142
|
+
> {"_key":"Monkey","name":"Grease"}
|
1143
|
+
> {"_key":"Flower","name":"Rose"}
|
1144
|
+
> ]
|
1145
|
+
[[0,1332498289.88434,0.801783800125122],2]
|
1146
|
+
> select \-\-table ToyBox \-\-output_columns _key,name
|
1147
|
+
[[0,1332498290.88724,0.000265598297119141],[[[3],[["_key","ShortText"],["name","ShortText"]],["Monkey","Grease"],["Flower","Rose"],["Block",""]]]]
|
932
1148
|
.ft P
|
933
1149
|
.fi
|
934
|
-
.SS
|
1150
|
+
.SS 日時
|
935
1151
|
.sp
|
936
|
-
|
1152
|
+
日時を表現するための型はTimeです。内部では1970年1月1日0時0分0秒を基準とする経過時間をマイクロ秒単位で表現します。符号付きの整数を用いるため、1970年以前の日時も表現することができます。内部表現はマイクロ秒単位の整数ですが、 \fB/commands/load\fP コマンドおよび \fB/commands/select\fP コマンドでは、経過秒数による指定・表示となります。デフォルト値は1970年1月1日0時0分0秒のことを表す0.0です。
|
937
1153
|
.sp
|
938
|
-
|
1154
|
+
以下の例では、Time型のカラムを作成し、IDが2と3のレコードを更新します。更新しないレコードについては、デフォルト値のままとなります。
|
939
1155
|
.sp
|
940
|
-
|
1156
|
+
実行例:
|
941
1157
|
.sp
|
942
|
-
|
1158
|
+
.nf
|
1159
|
+
.ft C
|
1160
|
+
> column_create \-\-table ToyBox \-\-name time \-\-type Time
|
1161
|
+
[[0,1332498291.0906,0.00631809234619141],true]
|
1162
|
+
> load \-\-table ToyBox
|
1163
|
+
> [
|
1164
|
+
> {"_key":"Flower","time":1234567890.1234569999}
|
1165
|
+
> {"_key":"Block","time":\-1234567890}
|
1166
|
+
> ]
|
1167
|
+
[[0,1332498291.29814,0.801807641983032],2]
|
1168
|
+
> select \-\-table ToyBox \-\-output_columns _key,time
|
1169
|
+
[[0,1332498292.30117,0.000299692153930664],[[[3],[["_key","ShortText"],["time","Time"]],["Monkey",0.0],["Flower",1234567890.12346],["Block",\-1234567890.0]]]]
|
1170
|
+
.ft P
|
1171
|
+
.fi
|
1172
|
+
.SS 経緯度
|
1173
|
+
.sp
|
1174
|
+
経緯度を表現するための型は、測地系によって分けることができます。詳しくは \fB/type\fP を参照してください。経緯度の指定・表示には、以下に示す形式の文字列を使います。
|
1175
|
+
.INDENT 0.0
|
1176
|
+
.IP \(bu 2
|
1177
|
+
"経度のミリ秒表記x緯度のミリ秒表記" (例: "128452975x503157902")
|
1178
|
+
.IP \(bu 2
|
1179
|
+
"経度の度数表記x緯度の度数表記" (例: "35.6813819x139.7660839")
|
1180
|
+
.UNINDENT
|
1181
|
+
.sp
|
1182
|
+
小数点を含んでいなければミリ秒表記、小数点を含んでいれば度数表記として扱われます。ミリ秒表記と度数表記を混ぜたときの動作は未定義なので注意してください。経度と緯度の区切りとしては、\(aqx\(aq のほかに \(aq,\(aq を使うことができます。経緯度のデフォルト値は "0x0" です。
|
1183
|
+
.sp
|
1184
|
+
以下の例では、世界測地系を用いるWGS84GeoPoint型のカラムを作成し、IDが1と3のレコードを更新します。更新しないレコードについては、デフォルト値のままとなります。
|
1185
|
+
.sp
|
1186
|
+
実行例:
|
1187
|
+
.sp
|
1188
|
+
.nf
|
1189
|
+
.ft C
|
1190
|
+
> column_create \-\-table ToyBox \-\-name location \-\-type WGS84GeoPoint
|
1191
|
+
[[0,1332498292.50467,0.0079643726348877],true]
|
1192
|
+
> load \-\-table ToyBox
|
1193
|
+
> [
|
1194
|
+
> {"_key":"Monkey","location":"128452975x503157902"}
|
1195
|
+
> {"_key":"Block","location":"35.6813819x139.7660839"}
|
1196
|
+
> ]
|
1197
|
+
[[0,1332498292.71385,0.801813840866089],2]
|
1198
|
+
> select \-\-table ToyBox \-\-output_columns _key,location
|
1199
|
+
[[0,1332498293.71678,0.000298976898193359],[[[3],[["_key","ShortText"],["location","WGS84GeoPoint"]],["Monkey","128452975x503157902"],["Flower","0x0"],["Block","128452975x503157902"]]]]
|
1200
|
+
.ft P
|
1201
|
+
.fi
|
1202
|
+
.SS テーブル参照
|
1203
|
+
.sp
|
1204
|
+
groongaでは、テーブル参照のカラム、すなわち関連付けたテーブルを参照するカラムを作成できます。より正確には、カラム作成時に参照先となるテーブルとの関連付けをおこない、参照先テーブルにおけるレコードIDを格納しておくことにより、参照先のレコードにアクセスできるようにします。
|
1205
|
+
.sp
|
1206
|
+
テーブル参照のカラムがあるときは、 \fIoutput_columns\fP 引数に "参照元カラム.参照先カラム" と指定することにより、参照先カラムの値を取り出すことができます。参照元カラムのみを指定したときは、 "参照元カラム名._key" と同様の扱いとなり、参照先レコードの主キーが取り出されます。テーブル参照が有効なレコードを指していないときは、参照先カラムのデフォルト値が取り出されるようになっています。
|
1207
|
+
.sp
|
1208
|
+
ここでは、先のチュートリアルで作成したSiteテーブルにlinkという新たなカラムを作成し、サイト間のリンク関係を保存できるようにしてみましょう。
|
943
1209
|
.sp
|
944
1210
|
実行例:
|
945
1211
|
.sp
|
946
1212
|
.nf
|
947
1213
|
.ft C
|
948
1214
|
> column_create \-\-table Site \-\-name link \-\-type Site
|
949
|
-
[[0,
|
1215
|
+
[[0,1332498293.92066,0.00589966773986816],true]
|
950
1216
|
> load \-\-table Site
|
951
1217
|
> [{"_key":"http://example.org/","link":"http://example.net/"}]
|
952
|
-
[[0,
|
1218
|
+
[[0,1332498294.1274,0.201014280319214],1]
|
953
1219
|
> select \-\-table Site \-\-output_columns _key,title,link._key,link.title \-\-query title:@this
|
954
|
-
[[0,
|
1220
|
+
[[0,1332498294.52959,0.00171041488647461],[[[1],[["_key","ShortText"],["title","ShortText"],["link._key","ShortText"],["link.title","ShortText"]],["http://example.org/","This is test record 1!","http://example.net/","test record 2."]]]]
|
955
1221
|
.ft P
|
956
1222
|
.fi
|
957
1223
|
.sp
|
958
|
-
|
1224
|
+
テーブル参照のカラムを作成するときは、 \fItype\fP 引数に参照先テーブルを指定します。この例では、同じテーブルに含まれる別のレコードを参照させたいので、Siteを指定することになります。次に、 "\fI\%http://example.org/\fP" から "\fI\%http://example.net/\fP" へのリンクを登録しています。テーブル参照を作成するときは、IDではなく主キーを指定することに注意してください。最後に、リンクの内容を確認しています。この例では、 \fIoutput_columns\fP 引数に link._key と link.title を指定しているので、参照先の主キーとタイトルが表示されています。
|
959
1225
|
.SS ベクターカラム
|
960
1226
|
.sp
|
961
|
-
column_create
|
1227
|
+
\fB/commands/column_create\fP コマンドでカラムを作成するとき、 \fIflags\fP 引数にCOLUMN_VECTORフラグを指定すると、 \fItype\fP 引数に指定した型の配列を格納するカラムになります。このようなカラムのことは、ベクターカラムと呼びます。ベクターカラムは、各レコードに複数の値を格納できるため、一対多の参照関係を表すのに便利です。
|
962
1228
|
.sp
|
963
|
-
|
964
|
-
.sp
|
965
|
-
テーブル型のチュートリアルでは、Siteテーブルに手を加え、どのサイトをリンクしているのかを保存しました。しかし、通常は1つのサイトから多くのサイトにリンクが張られています。複数のリンク情報を格納するために、複数の参照関係を保存するカラムを作成してみましょう。
|
966
|
-
.sp
|
967
|
-
他のテーブルを参照するベクターカラムにデータを入力する場合には、参照先のテーブルの_keyカラムの値の「配列」を代入する必要があります。
|
1229
|
+
さきほどテーブル参照の例として作成したカラムでは、各サイトに一つのリンクしか保存できませんでした。通常は一つのサイトから多くのサイトにリンクが張られているので、これでは残念な仕様になってしまいます。そこで、ベクターカラムを使って、複数のリンクを保存できるようにしてみましょう。
|
968
1230
|
.sp
|
969
1231
|
実行例:
|
970
1232
|
.sp
|
971
1233
|
.nf
|
972
1234
|
.ft C
|
973
1235
|
> column_create \-\-table Site \-\-name links \-\-flags COLUMN_VECTOR \-\-type Site
|
974
|
-
[[0,
|
1236
|
+
[[0,1332498294.7353,0.00729537010192871],true]
|
975
1237
|
> load \-\-table Site
|
976
1238
|
> [{"_key":"http://example.org/","links":["http://example.net/","http://example.org/","http://example.com/"]}]
|
977
|
-
[[0,
|
1239
|
+
[[0,1332498294.94353,0.200709581375122],1]
|
978
1240
|
> select \-\-table Site \-\-output_columns _key,title,links._key,links.title \-\-query title:@this
|
979
|
-
[[0,
|
1241
|
+
[[0,1332498295.34514,0.00077366828918457],[[[1],[["_key","ShortText"],["title","ShortText"],["links._key","ShortText"],["links.title","ShortText"]],["http://example.org/","This is test record 1!",["http://example.net/","http://example.org/","http://example.com/"],["test record 2.","This is test record 1!","test test record three."]]]]]
|
980
1242
|
.ft P
|
981
1243
|
.fi
|
982
1244
|
.sp
|
983
|
-
|
1245
|
+
新たなカラムにはSiteテーブルに対する参照の配列を格納するので、 \fItype\fP 引数にSiteを指定するとともに、 \fIflags\fP 引数にCOLUMN_VECTORフラグを指定しています。次に、 \fB/commands/load\fP による更新では、 "\fI\%http://example.org/\fP" から "\fI\%http://example.net/\fP" へのリンクに加えて、 "\fI\%http://example.org/\fP" と "\fI\%http://example.com/\fP" へのリンクも登録しています。そして、最後にリンクの内容を確認しています。この例では、 \fIoutput_columns\fP 引数に links._key と links.title を指定しているので、参照先の主キーとタイトルをそれぞれ配列にしたものが表示されています。
|
984
1246
|
.SS さまざまな検索条件の指定
|
985
1247
|
.sp
|
986
1248
|
groongaは、JavaScriptに似た文法での条件絞込や、計算した値を用いたソートを行うことができます。また、位置情報(緯度・経度)を用いた絞込・ソートを行うことができます。
|
@@ -5584,6 +5846,31 @@ groonga\-suggest\-create\-dataset /tmp/db\-path query
|
|
5584
5846
|
.B Default:
|
5585
5847
|
\fBauto\fP
|
5586
5848
|
.UNINDENT
|
5849
|
+
.TP
|
5850
|
+
.B \fBsimilar_search\fP
|
5851
|
+
補正時に類似検索を実行するかどうかを指定します。
|
5852
|
+
.sp
|
5853
|
+
指定可能な値は以下の通りです。
|
5854
|
+
.INDENT 7.0
|
5855
|
+
.INDENT 3.5
|
5856
|
+
.INDENT 0.0
|
5857
|
+
.TP
|
5858
|
+
.B \fByes\fP
|
5859
|
+
常に類似検索を実行します。
|
5860
|
+
.TP
|
5861
|
+
.B \fBno\fP
|
5862
|
+
類似検索を実行しません。
|
5863
|
+
.TP
|
5864
|
+
.B \fBauto\fP
|
5865
|
+
他の検索でレコードが見つからない場合のみ類似検索を実行します。
|
5866
|
+
.UNINDENT
|
5867
|
+
.UNINDENT
|
5868
|
+
.UNINDENT
|
5869
|
+
.INDENT 7.0
|
5870
|
+
.TP
|
5871
|
+
.B Default:
|
5872
|
+
\fBauto\fP
|
5873
|
+
.UNINDENT
|
5587
5874
|
.UNINDENT
|
5588
5875
|
.SS 返値
|
5589
5876
|
.SS JSON形式
|
@@ -6099,123 +6386,132 @@ groongaのデータベースでは、テーブルの主キーや、カラムの
|
|
6099
6386
|
\fBObject\fP
|
6100
6387
|
.INDENT 0.0
|
6101
6388
|
.INDENT 3.5
|
6102
|
-
|
6389
|
+
任意のテーブルに属する全てのレコードです。 [1]
|
6103
6390
|
.UNINDENT
|
6104
6391
|
.UNINDENT
|
6105
6392
|
.sp
|
6106
6393
|
\fBBool\fP
|
6107
6394
|
.INDENT 0.0
|
6108
6395
|
.INDENT 3.5
|
6109
|
-
|
6396
|
+
ブーリアン型やブール型などと呼ばれる型であり、真偽値を表します。取り得る値はtrueとfalseです。(デフォルト値: false)
|
6397
|
+
.sp
|
6398
|
+
\fB/commands/load\fP コマンドで値を格納するときは、false、0、空文字列のいずれかを指定するとfalseになり、それ以外を指定するとtrueになります。
|
6110
6399
|
.UNINDENT
|
6111
6400
|
.UNINDENT
|
6112
6401
|
.sp
|
6113
6402
|
\fBInt8\fP
|
6114
6403
|
.INDENT 0.0
|
6115
6404
|
.INDENT 3.5
|
6116
|
-
8bit
|
6405
|
+
8bit符号付き整数であり、\-128以上127以下の整数を表します。(デフォルト値: 0)
|
6117
6406
|
.UNINDENT
|
6118
6407
|
.UNINDENT
|
6119
6408
|
.sp
|
6120
6409
|
\fBUInt8\fP
|
6121
6410
|
.INDENT 0.0
|
6122
6411
|
.INDENT 3.5
|
6123
|
-
8bit
|
6412
|
+
8bit符号なし整数であり、0以上255以下の整数を表します。(デフォルト値: 0)
|
6124
6413
|
.UNINDENT
|
6125
6414
|
.UNINDENT
|
6126
6415
|
.sp
|
6127
6416
|
\fBInt16\fP
|
6128
6417
|
.INDENT 0.0
|
6129
6418
|
.INDENT 3.5
|
6130
|
-
16bit
|
6419
|
+
16bit符号付き整数であり、\-32,768以上32,767以下の整数を表します。(デフォルト値: 0)
|
6131
6420
|
.UNINDENT
|
6132
6421
|
.UNINDENT
|
6133
6422
|
.sp
|
6134
6423
|
\fBUInt16\fP
|
6135
6424
|
.INDENT 0.0
|
6136
6425
|
.INDENT 3.5
|
6137
|
-
16bit
|
6426
|
+
16bit符号なし整数であり、0以上65,535以下の整数を表します。(デフォルト値: 0)
|
6138
6427
|
.UNINDENT
|
6139
6428
|
.UNINDENT
|
6140
6429
|
.sp
|
6141
6430
|
\fBInt32\fP
|
6142
6431
|
.INDENT 0.0
|
6143
6432
|
.INDENT 3.5
|
6144
|
-
32bit
|
6433
|
+
32bit符号付き整数であり、\-2,147,483,648以上2,147,483,647以下の整数を表します。(デフォルト値: 0)
|
6145
6434
|
.UNINDENT
|
6146
6435
|
.UNINDENT
|
6147
6436
|
.sp
|
6148
6437
|
\fBUInt32\fP
|
6149
6438
|
.INDENT 0.0
|
6150
6439
|
.INDENT 3.5
|
6151
|
-
32bit
|
6440
|
+
32bit符号なし整数であり、0以上4,294,967,295以下の整数を表します。(デフォルト値: 0)
|
6152
6441
|
.UNINDENT
|
6153
6442
|
.UNINDENT
|
6154
6443
|
.sp
|
6155
6444
|
\fBInt64\fP
|
6156
6445
|
.INDENT 0.0
|
6157
6446
|
.INDENT 3.5
|
6158
|
-
64bit
|
6447
|
+
64bit符号付き整数であり、\-9,223,372,036,854,775,808以上9,223,372,036,854,775,807以下の整数を表します。(デフォルト値: 0)
|
6159
6448
|
.UNINDENT
|
6160
6449
|
.UNINDENT
|
6161
6450
|
.sp
|
6162
6451
|
\fBUInt64\fP
|
6163
6452
|
.INDENT 0.0
|
6164
6453
|
.INDENT 3.5
|
6165
|
-
64bit
|
6454
|
+
64bit符号なし整数であり、0以上18,446,744,073,709,551,615以下の整数を表します。(デフォルト値: 0)
|
6166
6455
|
.UNINDENT
|
6167
6456
|
.UNINDENT
|
6168
6457
|
.sp
|
6169
6458
|
\fBFloat\fP
|
6170
6459
|
.INDENT 0.0
|
6171
6460
|
.INDENT 3.5
|
6172
|
-
|
6461
|
+
IEEE 754形式の倍精度浮動小数点数であり、実数を表します。(デフォルト値: 0.0)
|
6462
|
+
.sp
|
6463
|
+
IEEE 754形式の詳細については、 \fI\%IEEE 754 - Wikipedia\fP や \fI\%IEEE 754: Standard for Binary Floating-Point\fP を参照してください。
|
6173
6464
|
.UNINDENT
|
6174
6465
|
.UNINDENT
|
6175
6466
|
.sp
|
6176
6467
|
\fBTime\fP
|
6177
6468
|
.INDENT 0.0
|
6178
6469
|
.INDENT 3.5
|
6179
|
-
1970年1月1日0時0分0
|
6470
|
+
日時を表す型であり、1970年1月1日0時0分0秒からの経過時間を、マイクロ秒単位で64bit符号付き整数により表現します。(デフォルト値: 0)
|
6471
|
+
.sp
|
6472
|
+
\fB/commands/load\fP コマンドで値を格納するときは、1970年1月1日0時0分0秒からの経過秒数を指定します。秒単位より詳細な日時を指定するには、小数を使います。
|
6180
6473
|
.UNINDENT
|
6181
6474
|
.UNINDENT
|
6182
6475
|
.sp
|
6183
6476
|
\fBShortText\fP
|
6184
6477
|
.INDENT 0.0
|
6185
6478
|
.INDENT 3.5
|
6186
|
-
|
6479
|
+
4,095バイト以下の文字列を表します。(デフォルト値: "")
|
6187
6480
|
.UNINDENT
|
6188
6481
|
.UNINDENT
|
6189
6482
|
.sp
|
6190
6483
|
\fBText\fP
|
6191
6484
|
.INDENT 0.0
|
6192
6485
|
.INDENT 3.5
|
6193
|
-
|
6486
|
+
65,535バイト以下の文字列を表します。(デフォルト値: "")
|
6194
6487
|
.UNINDENT
|
6195
6488
|
.UNINDENT
|
6196
6489
|
.sp
|
6197
6490
|
\fBLongText\fP
|
6198
6491
|
.INDENT 0.0
|
6199
6492
|
.INDENT 3.5
|
6200
|
-
|
6493
|
+
2,147,483,647バイト以下の文字列を表します。(デフォルト値: "")
|
6201
6494
|
.UNINDENT
|
6202
6495
|
.UNINDENT
|
6203
6496
|
.sp
|
6204
6497
|
\fBTokyoGeoPoint\fP
|
6205
6498
|
.INDENT 0.0
|
6206
6499
|
.INDENT 3.5
|
6207
|
-
|
6208
|
-
|
6209
|
-
|
6500
|
+
旧日本測地系による経緯度であり、経度と緯度をミリ秒単位で表現した整数の組により表現します。(デフォルト値: 0x0)
|
6501
|
+
.sp
|
6502
|
+
度分秒形式でx度y分z秒となる経度・緯度は、(((x * 60) + y) * 60 + z) * 1000という計算式でミリ秒単位へと変換されます。
|
6503
|
+
\fB/commands/load\fP コマンドで値を格納するときは、"ミリ秒単位の経度xミリ秒単位の緯度" もしくは "経度の小数表記x緯度の小数表記" という文字列表現を使って指定します。経度と緯度の区切りとしては、\(aqx\(aq のほかに \(aq,\(aq を使うことができます。
|
6504
|
+
.sp
|
6505
|
+
測地系の詳細については、 \fI\%測地系 - Wikipedia\fP を参照してください。
|
6210
6506
|
.UNINDENT
|
6211
6507
|
.UNINDENT
|
6212
6508
|
.sp
|
6213
6509
|
\fBWGS84GeoPoint\fP
|
6214
6510
|
.INDENT 0.0
|
6215
6511
|
.INDENT 3.5
|
6216
|
-
|
6217
|
-
|
6218
|
-
|
6512
|
+
世界測地系(World Geodetic System, WGS 84)による経緯度であり、経度と緯度をミリ秒単位で表現した整数の組により表現します。(デフォルト値: 0x0)
|
6513
|
+
.sp
|
6514
|
+
度分秒形式からミリ秒形式への変換方法や \fB/commands/load\fP コマンドにおける指定方法はTokyoGeoPointと同じです。
|
6219
6515
|
.UNINDENT
|
6220
6516
|
.UNINDENT
|
6221
6517
|
.SS 型に関する制限事項
|