rroonga 1.3.0-x86-mingw32 → 1.3.1-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +33 -2
- data/benchmark/common.rb +2 -2
- data/benchmark/read-write-many-small-items.rb +71 -62
- data/benchmark/write-many-small-items.rb +61 -53
- data/ext/groonga/rb-grn-context.c +23 -5
- data/ext/groonga/rb-grn-index-column.c +2 -6
- data/ext/groonga/rb-grn-operator.c +31 -1
- data/ext/groonga/rb-grn-variable-size-column.c +77 -1
- data/ext/groonga/rb-grn.h +2 -11
- data/ext/groonga/rb-groonga.c +1 -2
- data/lib/1.8/groonga.so +0 -0
- data/lib/1.9/groonga.so +0 -0
- data/lib/groonga/command.rb +169 -0
- data/lib/groonga/context.rb +4 -124
- data/lib/groonga/dumper.rb +10 -8
- data/lib/groonga/record.rb +7 -0
- data/lib/groonga/schema.rb +98 -7
- data/rroonga-build.rb +3 -3
- data/test/{test-context-select.rb → test-command-select.rb} +3 -3
- data/test/test-record.rb +18 -1
- data/test/test-schema-dumper.rb +48 -0
- data/test/test-schema-type.rb +35 -0
- data/test/test-schema.rb +81 -11
- data/test/test-table-select.rb +49 -38
- data/test/test-variable-size-column.rb +30 -0
- data/vendor/local/bin/grntest.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/mecab.exe +0 -0
- data/vendor/local/include/groonga/groonga/plugin.h +3 -2
- data/vendor/local/include/groonga/groonga.h +106 -78
- 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/pkgconfig/groonga.pc +5 -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/characteristic.txt +42 -32
- data/vendor/local/share/doc/groonga/en/html/_sources/commands/delete.txt +5 -1
- data/vendor/local/share/doc/groonga/en/html/_sources/commands/table_create.txt +5 -2
- data/vendor/local/share/doc/groonga/en/html/_sources/community.txt +4 -3
- data/vendor/local/share/doc/groonga/en/html/_sources/contribution.txt +8 -6
- data/vendor/local/share/doc/groonga/en/html/_sources/functions/geo_distance.txt +42 -3
- data/vendor/local/share/doc/groonga/en/html/_sources/functions/geo_in_circle.txt +26 -1
- data/vendor/local/share/doc/groonga/en/html/_sources/index.txt +2 -2
- data/vendor/local/share/doc/groonga/en/html/_sources/install.txt +102 -27
- data/vendor/local/share/doc/groonga/en/html/_sources/limitations.txt +10 -10
- data/vendor/local/share/doc/groonga/en/html/_sources/news.txt +130 -21
- data/vendor/local/share/doc/groonga/en/html/_sources/output.txt +164 -0
- data/vendor/local/share/doc/groonga/en/html/_sources/reference.txt +1 -0
- data/vendor/local/share/doc/groonga/en/html/_sources/suggest.txt +0 -5
- data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/data.txt +6 -4
- data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/drilldown.txt +1 -3
- data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/index.txt +2 -1
- data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/introduction.txt +95 -116
- data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/match_columns.txt +1 -4
- data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/micro_blog.txt +1 -4
- data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/network.txt +3 -0
- data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/patricia_trie.txt +1 -2
- data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/query_expansion.txt +5 -0
- data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/search.txt +3 -0
- data/vendor/local/share/doc/groonga/en/html/_sources/tutorial.txt +2 -2
- data/vendor/local/share/doc/groonga/en/html/_sources/type.txt +3 -3
- data/vendor/local/share/doc/groonga/en/html/_static/basic.css +13 -1
- data/vendor/local/share/doc/groonga/en/html/_static/doctools.js +5 -5
- data/vendor/local/share/doc/groonga/en/html/_static/searchtools.js +11 -7
- data/vendor/local/share/doc/groonga/en/html/_static/websupport.js +1 -1
- data/vendor/local/share/doc/groonga/en/html/characteristic.html +60 -52
- data/vendor/local/share/doc/groonga/en/html/command_version.html +30 -30
- data/vendor/local/share/doc/groonga/en/html/commands/cache_limit.html +34 -34
- data/vendor/local/share/doc/groonga/en/html/commands/check.html +34 -34
- data/vendor/local/share/doc/groonga/en/html/commands/clearlock.html +34 -34
- data/vendor/local/share/doc/groonga/en/html/commands/column_create.html +34 -34
- data/vendor/local/share/doc/groonga/en/html/commands/column_list.html +34 -34
- data/vendor/local/share/doc/groonga/en/html/commands/column_remove.html +34 -34
- data/vendor/local/share/doc/groonga/en/html/commands/define_selector.html +36 -36
- data/vendor/local/share/doc/groonga/en/html/commands/defrag.html +34 -34
- data/vendor/local/share/doc/groonga/en/html/commands/delete.html +38 -35
- data/vendor/local/share/doc/groonga/en/html/commands/dump.html +32 -32
- data/vendor/local/share/doc/groonga/en/html/commands/load.html +36 -36
- data/vendor/local/share/doc/groonga/en/html/commands/log_level.html +36 -36
- data/vendor/local/share/doc/groonga/en/html/commands/log_put.html +36 -36
- data/vendor/local/share/doc/groonga/en/html/commands/log_reopen.html +38 -38
- data/vendor/local/share/doc/groonga/en/html/commands/quit.html +32 -32
- data/vendor/local/share/doc/groonga/en/html/commands/select.html +38 -38
- data/vendor/local/share/doc/groonga/en/html/commands/shutdown.html +32 -32
- data/vendor/local/share/doc/groonga/en/html/commands/status.html +34 -34
- data/vendor/local/share/doc/groonga/en/html/commands/suggest.html +36 -36
- data/vendor/local/share/doc/groonga/en/html/commands/table_create.html +38 -36
- data/vendor/local/share/doc/groonga/en/html/commands/table_list.html +34 -34
- data/vendor/local/share/doc/groonga/en/html/commands/table_remove.html +34 -34
- data/vendor/local/share/doc/groonga/en/html/commands/view_add.html +34 -34
- data/vendor/local/share/doc/groonga/en/html/commands.html +41 -41
- data/vendor/local/share/doc/groonga/en/html/community.html +14 -12
- data/vendor/local/share/doc/groonga/en/html/contribution/development/com.html +7 -7
- data/vendor/local/share/doc/groonga/en/html/contribution/development/document.html +7 -7
- data/vendor/local/share/doc/groonga/en/html/contribution/development/query.html +7 -7
- data/vendor/local/share/doc/groonga/en/html/contribution/development/test.html +7 -7
- data/vendor/local/share/doc/groonga/en/html/contribution/development.html +7 -7
- data/vendor/local/share/doc/groonga/en/html/contribution/documentation/c-api.html +7 -7
- data/vendor/local/share/doc/groonga/en/html/contribution/documentation/i18n.html +7 -7
- data/vendor/local/share/doc/groonga/en/html/contribution/documentation.html +7 -7
- data/vendor/local/share/doc/groonga/en/html/contribution/report.html +7 -7
- data/vendor/local/share/doc/groonga/en/html/contribution.html +15 -13
- data/vendor/local/share/doc/groonga/en/html/executables/grnslap.html +7 -7
- data/vendor/local/share/doc/groonga/en/html/executables/grntest.html +7 -7
- data/vendor/local/share/doc/groonga/en/html/executables/groonga-http.html +7 -7
- data/vendor/local/share/doc/groonga/en/html/executables/groonga-suggest-create-dataset.html +12 -12
- data/vendor/local/share/doc/groonga/en/html/executables/groonga.html +7 -7
- data/vendor/local/share/doc/groonga/en/html/executables.html +7 -7
- data/vendor/local/share/doc/groonga/en/html/expr.html +25 -25
- data/vendor/local/share/doc/groonga/en/html/functions/edit_distance.html +32 -32
- data/vendor/local/share/doc/groonga/en/html/functions/geo_distance.html +71 -36
- data/vendor/local/share/doc/groonga/en/html/functions/geo_in_circle.html +53 -33
- data/vendor/local/share/doc/groonga/en/html/functions/geo_in_rectangle.html +32 -32
- data/vendor/local/share/doc/groonga/en/html/functions/now.html +30 -30
- data/vendor/local/share/doc/groonga/en/html/functions/rand.html +32 -32
- data/vendor/local/share/doc/groonga/en/html/functions.html +22 -22
- data/vendor/local/share/doc/groonga/en/html/genindex.html +7 -7
- data/vendor/local/share/doc/groonga/en/html/geolocation_search.html +7 -7
- data/vendor/local/share/doc/groonga/en/html/index.html +92 -87
- data/vendor/local/share/doc/groonga/en/html/install.html +109 -40
- data/vendor/local/share/doc/groonga/en/html/limitations.html +19 -19
- data/vendor/local/share/doc/groonga/en/html/log.html +21 -21
- data/vendor/local/share/doc/groonga/en/html/news/0.x.html +7 -7
- data/vendor/local/share/doc/groonga/en/html/news/1.0.x.html +7 -7
- data/vendor/local/share/doc/groonga/en/html/news/1.1.x.html +7 -7
- data/vendor/local/share/doc/groonga/en/html/news/senna.html +7 -7
- data/vendor/local/share/doc/groonga/en/html/news.html +233 -112
- data/vendor/local/share/doc/groonga/en/html/objects.inv +0 -0
- data/vendor/local/share/doc/groonga/en/html/output.html +302 -0
- data/vendor/local/share/doc/groonga/en/html/pseudo_column.html +21 -21
- data/vendor/local/share/doc/groonga/en/html/reference.html +59 -55
- data/vendor/local/share/doc/groonga/en/html/search.html +6 -6
- data/vendor/local/share/doc/groonga/en/html/searchindex.js +1 -1
- data/vendor/local/share/doc/groonga/en/html/spec/search.html +11 -11
- data/vendor/local/share/doc/groonga/en/html/spec.html +11 -11
- data/vendor/local/share/doc/groonga/en/html/suggest/completion.html +7 -7
- data/vendor/local/share/doc/groonga/en/html/suggest/correction.html +7 -7
- data/vendor/local/share/doc/groonga/en/html/suggest/introduction.html +7 -7
- data/vendor/local/share/doc/groonga/en/html/suggest/suggestion.html +7 -7
- data/vendor/local/share/doc/groonga/en/html/suggest/tutorial.html +7 -7
- data/vendor/local/share/doc/groonga/en/html/suggest.html +7 -12
- data/vendor/local/share/doc/groonga/en/html/troubleshooting/different_results_with_the_same_keyword.html +7 -7
- data/vendor/local/share/doc/groonga/en/html/troubleshooting.html +11 -11
- data/vendor/local/share/doc/groonga/en/html/tutorial/data.html +23 -23
- data/vendor/local/share/doc/groonga/en/html/tutorial/drilldown.html +10 -10
- data/vendor/local/share/doc/groonga/en/html/tutorial/index.html +10 -10
- data/vendor/local/share/doc/groonga/en/html/tutorial/introduction.html +124 -164
- data/vendor/local/share/doc/groonga/en/html/tutorial/lexicon.html +10 -10
- data/vendor/local/share/doc/groonga/en/html/tutorial/match_columns.html +10 -10
- data/vendor/local/share/doc/groonga/en/html/tutorial/micro_blog.html +10 -10
- data/vendor/local/share/doc/groonga/en/html/tutorial/network.html +14 -14
- data/vendor/local/share/doc/groonga/en/html/tutorial/patricia_trie.html +10 -10
- data/vendor/local/share/doc/groonga/en/html/tutorial/query_expansion.html +11 -10
- data/vendor/local/share/doc/groonga/en/html/tutorial/search.html +10 -10
- data/vendor/local/share/doc/groonga/en/html/tutorial.html +26 -26
- data/vendor/local/share/doc/groonga/en/html/type.html +31 -31
- data/vendor/local/share/doc/groonga/ja/html/.buildinfo +1 -1
- data/vendor/local/share/doc/groonga/ja/html/_sources/characteristic.txt +42 -32
- data/vendor/local/share/doc/groonga/ja/html/_sources/commands/delete.txt +5 -1
- data/vendor/local/share/doc/groonga/ja/html/_sources/commands/table_create.txt +5 -2
- data/vendor/local/share/doc/groonga/ja/html/_sources/community.txt +4 -3
- data/vendor/local/share/doc/groonga/ja/html/_sources/contribution.txt +8 -6
- data/vendor/local/share/doc/groonga/ja/html/_sources/functions/geo_distance.txt +42 -3
- data/vendor/local/share/doc/groonga/ja/html/_sources/functions/geo_in_circle.txt +26 -1
- data/vendor/local/share/doc/groonga/ja/html/_sources/index.txt +2 -2
- data/vendor/local/share/doc/groonga/ja/html/_sources/install.txt +102 -27
- data/vendor/local/share/doc/groonga/ja/html/_sources/limitations.txt +10 -10
- data/vendor/local/share/doc/groonga/ja/html/_sources/news.txt +130 -21
- data/vendor/local/share/doc/groonga/ja/html/_sources/output.txt +164 -0
- data/vendor/local/share/doc/groonga/ja/html/_sources/reference.txt +1 -0
- data/vendor/local/share/doc/groonga/ja/html/_sources/suggest.txt +0 -5
- data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/data.txt +6 -4
- data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/drilldown.txt +1 -3
- data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/index.txt +2 -1
- data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/introduction.txt +95 -116
- data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/match_columns.txt +1 -4
- data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/micro_blog.txt +1 -4
- data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/network.txt +3 -0
- data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/patricia_trie.txt +1 -2
- data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/query_expansion.txt +5 -0
- data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/search.txt +3 -0
- data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial.txt +2 -2
- data/vendor/local/share/doc/groonga/ja/html/_sources/type.txt +3 -3
- data/vendor/local/share/doc/groonga/ja/html/_static/basic.css +13 -1
- data/vendor/local/share/doc/groonga/ja/html/_static/doctools.js +5 -5
- data/vendor/local/share/doc/groonga/ja/html/_static/searchtools.js +11 -7
- data/vendor/local/share/doc/groonga/ja/html/_static/websupport.js +1 -1
- data/vendor/local/share/doc/groonga/ja/html/characteristic.html +55 -47
- data/vendor/local/share/doc/groonga/ja/html/command_version.html +30 -30
- data/vendor/local/share/doc/groonga/ja/html/commands/cache_limit.html +34 -34
- data/vendor/local/share/doc/groonga/ja/html/commands/check.html +34 -34
- data/vendor/local/share/doc/groonga/ja/html/commands/clearlock.html +34 -34
- data/vendor/local/share/doc/groonga/ja/html/commands/column_create.html +34 -34
- data/vendor/local/share/doc/groonga/ja/html/commands/column_list.html +34 -34
- data/vendor/local/share/doc/groonga/ja/html/commands/column_remove.html +34 -34
- data/vendor/local/share/doc/groonga/ja/html/commands/define_selector.html +36 -36
- data/vendor/local/share/doc/groonga/ja/html/commands/defrag.html +34 -34
- data/vendor/local/share/doc/groonga/ja/html/commands/delete.html +38 -35
- data/vendor/local/share/doc/groonga/ja/html/commands/dump.html +32 -32
- data/vendor/local/share/doc/groonga/ja/html/commands/load.html +36 -36
- data/vendor/local/share/doc/groonga/ja/html/commands/log_level.html +36 -36
- data/vendor/local/share/doc/groonga/ja/html/commands/log_put.html +36 -36
- data/vendor/local/share/doc/groonga/ja/html/commands/log_reopen.html +38 -38
- data/vendor/local/share/doc/groonga/ja/html/commands/quit.html +32 -32
- data/vendor/local/share/doc/groonga/ja/html/commands/select.html +38 -38
- data/vendor/local/share/doc/groonga/ja/html/commands/shutdown.html +32 -32
- data/vendor/local/share/doc/groonga/ja/html/commands/status.html +34 -34
- data/vendor/local/share/doc/groonga/ja/html/commands/suggest.html +36 -36
- data/vendor/local/share/doc/groonga/ja/html/commands/table_create.html +38 -36
- data/vendor/local/share/doc/groonga/ja/html/commands/table_list.html +34 -34
- data/vendor/local/share/doc/groonga/ja/html/commands/table_remove.html +34 -34
- data/vendor/local/share/doc/groonga/ja/html/commands/view_add.html +34 -34
- data/vendor/local/share/doc/groonga/ja/html/commands.html +41 -41
- data/vendor/local/share/doc/groonga/ja/html/community.html +10 -8
- data/vendor/local/share/doc/groonga/ja/html/contribution/development/com.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/contribution/development/document.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/contribution/development/query.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/contribution/development/test.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/contribution/development.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/contribution/documentation/c-api.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/contribution/documentation/i18n.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/contribution/documentation.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/contribution/report.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/contribution.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/executables/grnslap.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/executables/grntest.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/executables/groonga-http.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/executables/groonga-suggest-create-dataset.html +12 -12
- data/vendor/local/share/doc/groonga/ja/html/executables/groonga.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/executables.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/expr.html +25 -25
- data/vendor/local/share/doc/groonga/ja/html/functions/edit_distance.html +32 -32
- data/vendor/local/share/doc/groonga/ja/html/functions/geo_distance.html +71 -36
- data/vendor/local/share/doc/groonga/ja/html/functions/geo_in_circle.html +53 -33
- data/vendor/local/share/doc/groonga/ja/html/functions/geo_in_rectangle.html +32 -32
- data/vendor/local/share/doc/groonga/ja/html/functions/now.html +30 -30
- data/vendor/local/share/doc/groonga/ja/html/functions/rand.html +32 -32
- data/vendor/local/share/doc/groonga/ja/html/functions.html +22 -22
- data/vendor/local/share/doc/groonga/ja/html/genindex.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/geolocation_search.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/index.html +84 -79
- data/vendor/local/share/doc/groonga/ja/html/install.html +92 -16
- data/vendor/local/share/doc/groonga/ja/html/limitations.html +13 -13
- data/vendor/local/share/doc/groonga/ja/html/log.html +21 -21
- data/vendor/local/share/doc/groonga/ja/html/news/0.x.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/news/1.0.x.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/news/1.1.x.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/news/senna.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/news.html +202 -99
- data/vendor/local/share/doc/groonga/ja/html/objects.inv +0 -0
- data/vendor/local/share/doc/groonga/ja/html/output.html +287 -0
- data/vendor/local/share/doc/groonga/ja/html/pseudo_column.html +21 -21
- data/vendor/local/share/doc/groonga/ja/html/reference.html +59 -55
- data/vendor/local/share/doc/groonga/ja/html/search.html +6 -6
- data/vendor/local/share/doc/groonga/ja/html/searchindex.js +1 -1
- data/vendor/local/share/doc/groonga/ja/html/spec/search.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/spec.html +11 -11
- data/vendor/local/share/doc/groonga/ja/html/suggest/completion.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/suggest/correction.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/suggest/introduction.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/suggest/suggestion.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/suggest/tutorial.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/suggest.html +7 -11
- data/vendor/local/share/doc/groonga/ja/html/troubleshooting/different_results_with_the_same_keyword.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/troubleshooting.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/tutorial/data.html +20 -20
- data/vendor/local/share/doc/groonga/ja/html/tutorial/drilldown.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/tutorial/index.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/tutorial/introduction.html +93 -115
- data/vendor/local/share/doc/groonga/ja/html/tutorial/lexicon.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/tutorial/match_columns.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/tutorial/micro_blog.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/tutorial/network.html +8 -8
- data/vendor/local/share/doc/groonga/ja/html/tutorial/patricia_trie.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/tutorial/query_expansion.html +8 -7
- data/vendor/local/share/doc/groonga/ja/html/tutorial/search.html +7 -7
- data/vendor/local/share/doc/groonga/ja/html/tutorial.html +21 -21
- data/vendor/local/share/doc/groonga/ja/html/type.html +31 -31
- data/vendor/local/share/doc/groonga/source/characteristic.txt +42 -32
- data/vendor/local/share/doc/groonga/source/commands/delete.txt +5 -1
- data/vendor/local/share/doc/groonga/source/commands/table_create.txt +5 -2
- data/vendor/local/share/doc/groonga/source/community.txt +4 -3
- data/vendor/local/share/doc/groonga/source/contribution.txt +8 -6
- data/vendor/local/share/doc/groonga/source/example/tutorial/data-1.log +8 -8
- data/vendor/local/share/doc/groonga/source/example/tutorial/data-2.log +4 -4
- data/vendor/local/share/doc/groonga/source/example/tutorial/data-3.log +4 -4
- data/vendor/local/share/doc/groonga/source/example/tutorial/introduction-1.log +3 -15
- data/vendor/local/share/doc/groonga/source/example/tutorial/introduction-2.log +2 -7
- data/vendor/local/share/doc/groonga/source/example/tutorial/introduction-3.log +2 -7
- data/vendor/local/share/doc/groonga/source/functions/geo_distance.txt +42 -3
- data/vendor/local/share/doc/groonga/source/functions/geo_in_circle.txt +26 -1
- data/vendor/local/share/doc/groonga/source/index.txt +2 -2
- data/vendor/local/share/doc/groonga/source/install.txt +102 -27
- data/vendor/local/share/doc/groonga/source/limitations.txt +10 -10
- data/vendor/local/share/doc/groonga/source/news.txt +130 -21
- data/vendor/local/share/doc/groonga/source/output.txt +164 -0
- data/vendor/local/share/doc/groonga/source/reference.txt +1 -0
- data/vendor/local/share/doc/groonga/source/suggest.txt +0 -5
- data/vendor/local/share/doc/groonga/source/tutorial/data.txt +6 -4
- data/vendor/local/share/doc/groonga/source/tutorial/drilldown.txt +1 -3
- data/vendor/local/share/doc/groonga/source/tutorial/index.txt +2 -1
- data/vendor/local/share/doc/groonga/source/tutorial/introduction.txt +95 -116
- data/vendor/local/share/doc/groonga/source/tutorial/match_columns.txt +1 -4
- data/vendor/local/share/doc/groonga/source/tutorial/micro_blog.txt +1 -4
- data/vendor/local/share/doc/groonga/source/tutorial/network.txt +3 -0
- data/vendor/local/share/doc/groonga/source/tutorial/patricia_trie.txt +1 -2
- data/vendor/local/share/doc/groonga/source/tutorial/query_expansion.txt +5 -0
- data/vendor/local/share/doc/groonga/source/tutorial/search.txt +3 -0
- data/vendor/local/share/doc/groonga/source/tutorial.txt +2 -2
- data/vendor/local/share/doc/groonga/source/type.txt +3 -3
- data/vendor/local/share/groonga/examples/dictionary/html/js/dictionary.js +1 -0
- data/vendor/local/share/groonga/html/admin/index.html +40 -0
- data/vendor/local/share/groonga/html/admin/js/jquery.flot-0.7.min.js +6 -0
- data/vendor/local/share/groonga/html/admin/js/jquery.flot.license.txt +22 -0
- data/vendor/local/share/man/ja/man1/groonga.1 +560 -138
- data/vendor/local/share/man/man1/groonga.1 +637 -223
- metadata +887 -898
- data/ext/groonga/Makefile +0 -184
- data/ext/groonga/rb-grn-query.c +0 -260
- data/test/test-query.rb +0 -22
@@ -0,0 +1,164 @@
|
|
1
|
+
.. -*- rst -*-
|
2
|
+
|
3
|
+
.. highlightlang:: none
|
4
|
+
|
5
|
+
Output
|
6
|
+
======
|
7
|
+
|
8
|
+
Groonga supports the following output format types:
|
9
|
+
|
10
|
+
* `JSON <http://www.json.org/>`_
|
11
|
+
* `XML <http://www.w3.org/XML/>`_
|
12
|
+
* TSV (Tab Separated Values)
|
13
|
+
* `MessagePack <http://msgpack.org/>`_
|
14
|
+
|
15
|
+
JSON is the default output format.
|
16
|
+
|
17
|
+
Usage
|
18
|
+
-----
|
19
|
+
|
20
|
+
Groonga has the following query interfaces:
|
21
|
+
|
22
|
+
* command line
|
23
|
+
* HTTP
|
24
|
+
|
25
|
+
They provides different ways to change output format type.
|
26
|
+
|
27
|
+
Command line
|
28
|
+
^^^^^^^^^^^^
|
29
|
+
|
30
|
+
You can use command line query interface by ``groonga
|
31
|
+
DB_PATH`` or ``groonga -c``. Those groonga commands shows
|
32
|
+
``> `` prompt. In this query interface, you can specify
|
33
|
+
output format type by ``output_type`` option.
|
34
|
+
|
35
|
+
If you don't specify ``output_type`` option, you will get
|
36
|
+
a result in JSON format::
|
37
|
+
|
38
|
+
> status
|
39
|
+
[[0,1327721628.10738,0.000131845474243164],{"alloc_count":142,"starttime":1327721626,"uptime":2,"version":"1.2.9-92-gb87d9f8","n_queries":0,"cache_hit_rate":0.0,"command_version":1,"default_command_version":1,"max_command_version":2}]
|
40
|
+
|
41
|
+
You can specify ``json`` as ``output_type`` value to get a
|
42
|
+
result in JSON format explicitly::
|
43
|
+
|
44
|
+
> status --output_type json
|
45
|
+
[[0,1327721639.08321,7.93933868408203e-05],{"alloc_count":144,"starttime":1327721626,"uptime":13,"version":"1.2.9-92-gb87d9f8","n_queries":0,"cache_hit_rate":0.0,"command_version":1,"default_command_version":1,"max_command_version":2}]
|
46
|
+
|
47
|
+
You need to specify ``xml`` as ``output_type`` value to
|
48
|
+
get a result in XML format::
|
49
|
+
|
50
|
+
> status --output_type xml
|
51
|
+
<?xml version="1.0" encoding="utf-8"?>
|
52
|
+
<RESULT CODE="0" UP="1327721649.61095" ELAPSED="0.000126361846923828">
|
53
|
+
<RESULT>
|
54
|
+
<TEXT>alloc_count</TEXT>
|
55
|
+
<INT>146</INT>
|
56
|
+
<TEXT>starttime</TEXT>
|
57
|
+
<INT>1327721626</INT>
|
58
|
+
<TEXT>uptime</TEXT>
|
59
|
+
<INT>23</INT>
|
60
|
+
<TEXT>version</TEXT>
|
61
|
+
<TEXT>1.2.9-92-gb87d9f8</TEXT>
|
62
|
+
<TEXT>n_queries</TEXT>
|
63
|
+
<INT>0</INT>
|
64
|
+
<TEXT>cache_hit_rate</TEXT>
|
65
|
+
<FLOAT>0.0</FLOAT>
|
66
|
+
<TEXT>command_version</TEXT>
|
67
|
+
<INT>1</INT>
|
68
|
+
<TEXT>default_command_version</TEXT>
|
69
|
+
<INT>1</INT>
|
70
|
+
<TEXT>max_command_version</TEXT>
|
71
|
+
<INT>2</INT></RESULT>
|
72
|
+
</RESULT>
|
73
|
+
|
74
|
+
You need to specify ``tsv`` as ``output_type`` value to
|
75
|
+
get a result in TSV format::
|
76
|
+
|
77
|
+
> status --output_type tsv
|
78
|
+
0 1327721664.82675 0.000113964080810547
|
79
|
+
"alloc_count" 146
|
80
|
+
"starttime" 1327721626
|
81
|
+
"uptime" 38
|
82
|
+
"version" "1.2.9-92-gb87d9f8"
|
83
|
+
"n_queries" 0
|
84
|
+
"cache_hit_rate" 0.0
|
85
|
+
"command_version" 1
|
86
|
+
"default_command_version" 1
|
87
|
+
"max_command_version" 2
|
88
|
+
END
|
89
|
+
|
90
|
+
|
91
|
+
You need to specify ``msgpack`` as ``output_type`` value to
|
92
|
+
get a result in MessagePack format::
|
93
|
+
|
94
|
+
> status --output_type msgpack
|
95
|
+
(... omitted because MessagePack is binary data format. ...)
|
96
|
+
|
97
|
+
HTTP
|
98
|
+
^^^^
|
99
|
+
|
100
|
+
You can use HTTP query interface by ``groonga --protocol
|
101
|
+
http -s DB_PATH``. Groonga HTTP server starts on port 10041
|
102
|
+
by default. In this query interface, you can specify
|
103
|
+
output format type by extension.
|
104
|
+
|
105
|
+
If you don't specify extension, you will get a result in
|
106
|
+
JSON format::
|
107
|
+
|
108
|
+
% curl http://localhost:10041/d/status
|
109
|
+
[[0,1327809294.54311,0.00082087516784668],{"alloc_count":155,"starttime":1327809282,"uptime":12,"version":"1.2.9-92-gb87d9f8","n_queries":0,"cache_hit_rate":0.0,"command_version":1,"default_command_version":1,"max_command_version":2}]
|
110
|
+
|
111
|
+
You can specify ``json`` as extension to get a result in
|
112
|
+
JSON format explicitly::
|
113
|
+
|
114
|
+
% curl http://localhost:10041/d/status.json
|
115
|
+
[[0,1327809319.01929,9.5367431640625e-05],{"alloc_count":157,"starttime":1327809282,"uptime":37,"version":"1.2.9-92-gb87d9f8","n_queries":0,"cache_hit_rate":0.0,"command_version":1,"default_command_version":1,"max_command_version":2}]
|
116
|
+
|
117
|
+
You need to specify ``xml`` as extension to get a result in
|
118
|
+
XML format::
|
119
|
+
|
120
|
+
% curl http://localhost:10041/d/status.xml
|
121
|
+
<?xml version="1.0" encoding="utf-8"?>
|
122
|
+
<RESULT CODE="0" UP="1327809339.5782" ELAPSED="9.56058502197266e-05">
|
123
|
+
<RESULT>
|
124
|
+
<TEXT>alloc_count</TEXT>
|
125
|
+
<INT>159</INT>
|
126
|
+
<TEXT>starttime</TEXT>
|
127
|
+
<INT>1327809282</INT>
|
128
|
+
<TEXT>uptime</TEXT>
|
129
|
+
<INT>57</INT>
|
130
|
+
<TEXT>version</TEXT>
|
131
|
+
<TEXT>1.2.9-92-gb87d9f8</TEXT>
|
132
|
+
<TEXT>n_queries</TEXT>
|
133
|
+
<INT>0</INT>
|
134
|
+
<TEXT>cache_hit_rate</TEXT>
|
135
|
+
<FLOAT>0.0</FLOAT>
|
136
|
+
<TEXT>command_version</TEXT>
|
137
|
+
<INT>1</INT>
|
138
|
+
<TEXT>default_command_version</TEXT>
|
139
|
+
<INT>1</INT>
|
140
|
+
<TEXT>max_command_version</TEXT>
|
141
|
+
<INT>2</INT></RESULT>
|
142
|
+
</RESULT>
|
143
|
+
|
144
|
+
You need to specify ``tsv`` as extension to get a result in
|
145
|
+
TSV format::
|
146
|
+
|
147
|
+
% curl http://localhost:10041/d/status.tsv
|
148
|
+
0 1327809366.84187 8.44001770019531e-05
|
149
|
+
"alloc_count" 159
|
150
|
+
"starttime" 1327809282
|
151
|
+
"uptime" 84
|
152
|
+
"version" "1.2.9-92-gb87d9f8"
|
153
|
+
"n_queries" 0
|
154
|
+
"cache_hit_rate" 0.0
|
155
|
+
"command_version" 1
|
156
|
+
"default_command_version" 1
|
157
|
+
"max_command_version" 2
|
158
|
+
END
|
159
|
+
|
160
|
+
You need to specify ``msgpack`` as extension to get a result
|
161
|
+
in MessagePack format::
|
162
|
+
|
163
|
+
% curl http://localhost:10041/d/status.msgpack
|
164
|
+
(... omitted because MessagePack is binary data format. ...)
|
@@ -4,6 +4,9 @@
|
|
4
4
|
|
5
5
|
.. groonga-include : introduction.txt
|
6
6
|
|
7
|
+
.. groonga-command
|
8
|
+
.. database: tutorial
|
9
|
+
|
7
10
|
さまざまな種類をもったデータの保存
|
8
11
|
==================================
|
9
12
|
|
@@ -19,8 +22,7 @@ groongaでは、数値(整数・小数)や文字列や時刻や経緯度な
|
|
19
22
|
その他のデータ型の一覧は、 :doc:`/type` を参照してください。
|
20
23
|
|
21
24
|
.. groonga-command
|
22
|
-
..
|
23
|
-
.. include:: ../example/tutorial/introduction-1.log
|
25
|
+
.. include:: ../example/tutorial/data-1.log
|
24
26
|
.. table_create --name Type --flags TABLE_HASH_KEY --key_type ShortText
|
25
27
|
.. column_create --table Type --name number --type Int32
|
26
28
|
.. column_create --table Type --name float --type Float
|
@@ -43,7 +45,7 @@ table_createで作成したテーブルを、カラムの型として使うこ
|
|
43
45
|
他のテーブルを参照するカラムにデータを入力する場合には、参照先のテーブルの_keyカラムの値を代入する必要があります。
|
44
46
|
|
45
47
|
.. groonga-command
|
46
|
-
.. include:: ../example/tutorial/
|
48
|
+
.. include:: ../example/tutorial/data-2.log
|
47
49
|
.. column_create --table Site --name link --type Site
|
48
50
|
.. load --table Site
|
49
51
|
.. [{"_key":"http://example.org/","link":"http://example.net/"}]
|
@@ -65,7 +67,7 @@ column_createコマンドでカラムを作成するとき、--flagsオプショ
|
|
65
67
|
.. FIXME: _idの配列ではダメなのかどうか。検証する。
|
66
68
|
|
67
69
|
.. groonga-command
|
68
|
-
.. include:: ../example/tutorial/
|
70
|
+
.. include:: ../example/tutorial/data-3.log
|
69
71
|
.. column_create --table Site --name links --flags COLUMN_VECTOR --type Site
|
70
72
|
.. load --table Site
|
71
73
|
.. [{"_key":"http://example.org/","links":["http://example.net/","http://example.org/","http://example.com/"]}]
|
@@ -4,176 +4,164 @@
|
|
4
4
|
|
5
5
|
.. groonga-command
|
6
6
|
.. database: tutorial
|
7
|
-
.. table_remove Site
|
8
|
-
.. table_remove Terms
|
9
7
|
|
10
|
-
|
11
|
-
|
8
|
+
Basic operations
|
9
|
+
================
|
12
10
|
|
13
|
-
|
14
|
-
This tutorial explains how to use groonga as an executable file.
|
15
|
-
Using its file, you can create and operate databases, start and connect to server, and so on.
|
11
|
+
The groonga package provides a C library (libgroonga) and a command line tool (groonga). This tutorial explains how to use the groonga command, with which you can create/operate databases, start a server, establish a connection with a server, etc.
|
16
12
|
|
17
|
-
Create database
|
18
|
-
|
13
|
+
Create a database
|
14
|
+
-----------------
|
19
15
|
|
20
|
-
You can create a new database
|
16
|
+
You can create a new database with the following command.
|
21
17
|
|
22
|
-
Form
|
18
|
+
Form::
|
23
19
|
|
24
20
|
groonga -n DB_PATH_NAME
|
25
21
|
|
26
|
-
'-n' option specifies to create a database. DB_PATH_NAME specifies
|
22
|
+
The '-n' option specifies to create a new database. DB_PATH_NAME specifies the path of the new database. Note that this command fails if the specified path already exists.
|
27
23
|
|
28
|
-
|
24
|
+
This command creates a database and then enters into interactive mode in which groonga prompts you to enter commands for operating that database. You can terminate this mode with Ctrl-d.
|
29
25
|
|
30
26
|
Execution example::
|
31
27
|
|
32
28
|
% groonga -n /tmp/tutorial.db
|
33
|
-
>
|
29
|
+
> Ctrl-d
|
34
30
|
%
|
35
31
|
|
36
|
-
Operate database
|
37
|
-
|
32
|
+
Operate a database
|
33
|
+
------------------
|
38
34
|
|
39
|
-
Form
|
35
|
+
Form::
|
40
36
|
|
41
37
|
groonga DB_PATH_NAME [COMMAND]
|
42
38
|
|
43
|
-
DB_PATH_NAME specifies
|
44
|
-
If COMMAND is specified, result of COMMAND is returned.
|
39
|
+
DB_PATH_NAME specifies the path of a target database.
|
45
40
|
|
46
|
-
|
47
|
-
Groonga of this mode reads a command from standard input evaluates it repeatedly.
|
48
|
-
This tutorial uses interactive-mode mainly.
|
41
|
+
If COMMAND is specified, groonga executes COMMAND and returns the result. Otherwise, groonga starts in interactive mode that reads commands from the standard input and execute them one by one. This tutorial focuses on the interactive mode.
|
49
42
|
|
50
|
-
|
51
|
-
This command returns status of groonga's execution.
|
43
|
+
Let's try to see the status of a groonga process by using a :doc:`/commands/status` command.
|
52
44
|
|
53
45
|
.. groonga-command
|
54
46
|
.. include:: ../example/tutorial/introduction-1.log
|
55
47
|
.. .. % groonga -n /tmp/groonga-databases/introduction.db
|
56
48
|
.. status
|
57
49
|
|
58
|
-
|
59
|
-
The first element in a array of JSON has information of error-code, execution time, and so on.
|
60
|
-
The second element has a result of exectuted command.
|
50
|
+
As shown in the above example, a command basically returns a JSON array. The first element contains an error code, execution time, etc. The second element is the result of an operation.
|
61
51
|
|
62
|
-
|
63
|
-
|
52
|
+
Command format
|
53
|
+
--------------
|
64
54
|
|
65
|
-
|
66
|
-
There are forms of commands in the following::
|
55
|
+
Commands for operating a database accept arguments as follows::
|
67
56
|
|
68
|
-
|
57
|
+
Form_1: COMMAND VALUE_1 VALUE_2 ..
|
69
58
|
|
70
|
-
|
59
|
+
Form_2: COMMAND --NAME_1 VALUE_1 --NAME_2 VALUE_2 ..
|
71
60
|
|
72
|
-
|
61
|
+
In the first form, arguments must be passed in order. This kind of arguments are called positional arguments because the position of each argument determines its meaning.
|
73
62
|
|
74
|
-
In
|
63
|
+
In the second form, you can specify a parameter name with its value. So, the order of arguments is not defined. This kind of arguments are known as named parameters or keyword arguments.
|
75
64
|
|
76
|
-
|
65
|
+
If you want to specify a value which contains white-spaces or special characters, such as quotes and parentheses, please enclose the value with single-quotes or double-quotes.
|
77
66
|
|
78
|
-
|
79
|
-
|
67
|
+
For details, see also the paragraph of "command" in :doc:`/executables/groonga`.
|
68
|
+
|
69
|
+
Basic commands
|
70
|
+
--------------
|
80
71
|
|
81
72
|
:doc:`/commands/status`
|
82
|
-
|
73
|
+
shows status of a groonga process.
|
83
74
|
:doc:`/commands/table_list`
|
84
|
-
|
75
|
+
shows a list of tables in a database.
|
85
76
|
:doc:`/commands/column_list`
|
86
|
-
|
77
|
+
shows a list of columns in a table.
|
87
78
|
:doc:`/commands/table_create`
|
88
|
-
|
79
|
+
adds a table to a database.
|
89
80
|
:doc:`/commands/column_create`
|
90
|
-
|
81
|
+
adds a column to a table.
|
91
82
|
:doc:`/commands/select`
|
92
|
-
|
83
|
+
searches records from a table and shows the result.
|
93
84
|
:doc:`/commands/load`
|
94
|
-
|
85
|
+
inserts records to a table.
|
95
86
|
|
96
|
-
Create table
|
97
|
-
|
87
|
+
Create a table
|
88
|
+
--------------
|
98
89
|
|
99
|
-
:doc:`/commands/table_create` creates table.
|
90
|
+
A :doc:`/commands/table_create` command creates a table.
|
100
91
|
|
101
|
-
In
|
102
|
-
Master key should be specified the types and the way to store.
|
92
|
+
In most cases, a table of groonga has a primary key which must be specified with its data type and index type.
|
103
93
|
|
104
|
-
|
105
|
-
Please imagine it as expressing sort of data.
|
106
|
-
How to store master key defines speed of search with master key and advisability of begins-with-match search. This is also explained in this tutorial later.
|
94
|
+
There are various data types such as integers, floating-point numbers, etc. The index type determines the search performance and the availability of prefix searches. We will explain the details later.
|
107
95
|
|
108
|
-
|
96
|
+
Let's create a 'Site' table which has a primary key of ShortText. In this example, the index type is HASH.
|
109
97
|
|
110
98
|
.. groonga-command
|
111
99
|
.. include:: ../example/tutorial/introduction-2.log
|
112
100
|
.. table_create --name Site --flags TABLE_HASH_KEY --key_type ShortText
|
113
101
|
|
114
|
-
|
115
|
-
|
102
|
+
View a table
|
103
|
+
------------
|
116
104
|
|
117
|
-
:doc:`/commands/select` shows contents of table.
|
105
|
+
A :doc:`/commands/select` command shows contents of table.
|
118
106
|
|
119
107
|
.. groonga-command
|
120
108
|
.. include:: ../example/tutorial/introduction-3.log
|
121
109
|
.. select --table Site
|
122
110
|
|
123
|
-
|
111
|
+
When only a table is specified, the 'select' command returns the first (at most) 10 records of that table. "[0]" in the result shows the number of records in the 'Site' table. The next array is a list of columns. ["_id","Uint32"] is a column of UInt32, named "_id". ["_key","ShortText"] is a column of ShortText, named "_key".
|
124
112
|
|
125
|
-
|
113
|
+
The above two columns, '_id' and '_key', are the necessary columns. The '_id' column stores IDs those are automatically allocated by groonga. The '_key' column is associated with the primary key. You are not allowed to rename these columns.
|
126
114
|
|
127
|
-
Create
|
128
|
-
|
115
|
+
Create a column
|
116
|
+
---------------
|
129
117
|
|
130
|
-
:doc:`/commands/column_create` command
|
118
|
+
A :doc:`/commands/column_create` command adds a column to a table.
|
131
119
|
|
132
|
-
|
120
|
+
Let's add a column of ShortText to store titles. You may give a descriptive name 'title' to the column.
|
133
121
|
|
134
122
|
.. groonga-command
|
135
123
|
.. include:: ../example/tutorial/introduction-4.log
|
136
124
|
.. column_create --table Site --name title --flags COLUMN_SCALAR --type ShortText
|
137
125
|
.. select --table Site
|
138
126
|
|
139
|
-
COLUMN_SCALAR
|
127
|
+
The COLUMN_SCALAR flag specifies to add a regular column.
|
140
128
|
|
141
|
-
Create
|
142
|
-
|
129
|
+
Create a lexicon table for full text searches
|
130
|
+
---------------------------------------------
|
143
131
|
|
144
|
-
|
132
|
+
Let's go on to how to make a full text search.
|
145
133
|
|
146
|
-
|
147
|
-
|
148
|
-
|
134
|
+
Groonga uses an inverted index to provide fast full text search. So, the first step is to create a lexicon table which stores an inverted index, also known as postings lists. The primary key of this table is associated with a vocabulary made up of index terms and each record stores postings lists for one index term.
|
135
|
+
|
136
|
+
The following shows a command which creates a lexicon table named 'Terms'. The data type of its primary key is ShortText.
|
149
137
|
|
150
138
|
.. groonga-command
|
151
139
|
.. include:: ../example/tutorial/introduction-5.log
|
152
140
|
.. table_create --name Terms --flags TABLE_PAT_KEY|KEY_NORMALIZE --key_type ShortText --default_tokenizer TokenBigram
|
153
141
|
|
154
|
-
|
155
|
-
|
156
|
-
|
142
|
+
The table_create command takes many parameters but you don't need to understand all of them. Please skip the next paragraph if you are not interested in how it works.
|
143
|
+
|
144
|
+
The 'TABLE_PAT_KEY' flag specifies to store index terms in a patricia trie. The 'KEY_NORMALIZE' flag specifies to normalize index terms. In this example, both flags are validated by using a '|'. The 'default_tokenizer' parameter specifies a method for tokenizing text. This example specifies 'TokenBigram' that is generally called 'N-gram'.
|
157
145
|
|
158
|
-
|
159
|
-
|
146
|
+
Create an index column for full text search
|
147
|
+
-------------------------------------------
|
160
148
|
|
161
|
-
|
162
|
-
----------------------------------------
|
149
|
+
The second step is to create an index column, which allows you to search records from its associated column. That is to say this step specifies which column needs an index.
|
163
150
|
|
164
|
-
|
151
|
+
Let's create an index column for the 'title' column in the 'Site' table.
|
165
152
|
|
166
153
|
.. groonga-command
|
167
154
|
.. include:: ../example/tutorial/introduction-6.log
|
168
155
|
.. column_create --table Terms --name blog_title --flags COLUMN_INDEX|WITH_POSITION --type Site --source title
|
169
156
|
|
170
|
-
This command creates index column 'blog_title' in '
|
171
|
-
In execution example, 'COLUMN_INDEX|WITH_POSITION' for '--flags' option specifies that this column is index column for storing information of terminology existing position. This option should be specified 'COLUMN_INDEX|WITH_POSITION' in generally fulltext searching. This tutorial does not deal with the reason why store information of terminology existing position.
|
157
|
+
This command creates an index column 'blog_title' in the 'Terms' table. The '--type' option specifies a target table and the '--source' option specifies a target column. Then, the 'COLUMN_INDEX' flag specifies to create an index column and the 'WITH_POSITION' flag specifies to create a full inverted index, which contains the positions of each index term. This combination 'COLUMN_INDEX|WITH_POSITION' is recommended for the general purpose.
|
172
158
|
|
173
159
|
Load data
|
174
160
|
---------
|
175
161
|
|
176
|
-
:doc:`/commands/load`
|
162
|
+
A :doc:`/commands/load` command loads JSON-formatted records into a table.
|
163
|
+
|
164
|
+
The following adds nine records to the 'Site' table.
|
177
165
|
|
178
166
|
.. groonga-command
|
179
167
|
.. include:: ../example/tutorial/introduction-7.log
|
@@ -190,7 +178,7 @@ Load data
|
|
190
178
|
.. {"_key":"http://example.com/vdw","title":"test test record nine."},
|
191
179
|
.. ]
|
192
180
|
|
193
|
-
Let's make sure that
|
181
|
+
Let's make sure that these records are correctly stored.
|
194
182
|
|
195
183
|
.. groonga-command
|
196
184
|
.. include:: ../example/tutorial/introduction-8.log
|
@@ -199,69 +187,60 @@ Let's make sure that its table has data with 'select' command.
|
|
199
187
|
Search data
|
200
188
|
-----------
|
201
189
|
|
202
|
-
|
190
|
+
Before a full text search, let's try to search data by '_id' and '_key'. These columns work as unique keys.
|
203
191
|
|
204
|
-
You can search
|
192
|
+
You can search records by using a 'select' command with a 'query' parameter.
|
205
193
|
|
206
194
|
.. groonga-command
|
207
195
|
.. include:: ../example/tutorial/introduction-9.log
|
208
196
|
.. select --table Site --query _id:1
|
209
197
|
|
210
|
-
'_id:1'
|
198
|
+
'_id:1' specifies to search a record whose ID is 1.
|
211
199
|
|
212
|
-
|
200
|
+
Next, let's search a record by a primary key.
|
213
201
|
|
214
202
|
.. groonga-command
|
215
203
|
.. include:: ../example/tutorial/introduction-10.log
|
216
204
|
.. select --table Site --query "_key:\"http://example.org/\""
|
217
205
|
|
218
|
-
'_key:\"http://example.org/\"'
|
219
|
-
|
206
|
+
'_key:\"http://example.org/\"' specifies to search a record whose primary key is "http://example.org/".
|
220
207
|
|
221
|
-
|
222
|
-
|
208
|
+
Full text search
|
209
|
+
----------------
|
223
210
|
|
224
|
-
|
211
|
+
It's time to make a full text search. You can make a full text search query with the same 'query' parameter.
|
225
212
|
|
226
213
|
.. groonga-command
|
227
214
|
.. include:: ../example/tutorial/introduction-11.log
|
228
215
|
.. select --table Site --query title:@this
|
229
216
|
|
230
|
-
This command
|
231
|
-
|
232
|
-
"title:@this" specified 'query' parameter means to search records whose 'title' column including 'this' string.
|
217
|
+
This command searches records whose 'title' column contains a string 'this'. In this case, only one record matches this query. Note that the lower case query 'this' matches a capitalized 'This' in the 1st record because 'KEY_NORMALIZE' was specified in lexicon column creation.
|
233
218
|
|
234
|
-
'select' command has parameter 'match_columns'.
|
219
|
+
The 'select' command has an optional parameter 'match_columns'. This parameter specifies default target columns and it is used when target columns are not specified in a query.[1]_
|
235
220
|
|
236
|
-
|
237
|
-
|
238
|
-
If you specify 'match_columns' is 'title' and 'query' is 'this', you can take same result as above query.
|
221
|
+
A combination of '--match_columns title' and '--query this' brings you the same result that '--query title:@this' does.
|
239
222
|
|
240
223
|
.. groonga-command
|
241
224
|
.. include:: ../example/tutorial/introduction-12.log
|
242
225
|
.. select --table Site --match_columns title --query this
|
243
226
|
|
244
|
-
Specify output
|
245
|
-
|
246
|
-
|
247
|
-
'output_columns' parameter in 'select' command specifies columns shown in result of search.
|
227
|
+
Specify output columns
|
228
|
+
----------------------
|
248
229
|
|
249
|
-
If you want to specify
|
230
|
+
An 'output_columns' parameter in a 'select' command specifies columns to be shown in the search result. If you want to specify more than one columns, please separate column names by commas (,).
|
250
231
|
|
251
232
|
.. groonga-command
|
252
233
|
.. include:: ../example/tutorial/introduction-13.log
|
253
234
|
.. select --table Site --output_columns _key,title,_score --query title:@test
|
254
235
|
|
255
|
-
|
236
|
+
This command specifies three output columns including the '_score' column, which stores the relevance score of each record.
|
256
237
|
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
'select' command can display result in only specified ranges using 'offset' and 'limit' parameter. This parameters is useful when you want to show only a page in much result of searching.
|
238
|
+
Specify output ranges
|
239
|
+
---------------------
|
261
240
|
|
262
|
-
'
|
241
|
+
A 'select' command returns a part of its search result if 'offset' and/or 'limit' parameters are specified. These parameters are useful to paginate a search result, a widely-used interface which shows a search result on a page by page basis.
|
263
242
|
|
264
|
-
'limit' parameter specifies
|
243
|
+
An 'offset' parameter specifies the starting point and a 'limit' parameter specifies the maximum number of records to be returned. If you need the first record in a search result, the offset parameter must be 0 or omitted.
|
265
244
|
|
266
245
|
.. groonga-command
|
267
246
|
.. include:: ../example/tutorial/introduction-14.log
|
@@ -270,23 +249,23 @@ Ranges to display
|
|
270
249
|
.. select --table Site --offset 7 --limit 3
|
271
250
|
|
272
251
|
Sort
|
273
|
-
|
252
|
+
----
|
274
253
|
|
275
|
-
|
254
|
+
A 'select' command sorts its result when used with a 'sortby' parameter.
|
276
255
|
|
277
|
-
|
256
|
+
A 'sortby' parameter specifies a column as a sorting creteria. A search result is arranged in ascending order of the column values. If you want to sort a search result in reverse order, please add a leading hyphen (-) to the column name of a parameter.
|
278
257
|
|
279
258
|
.. groonga-command
|
280
259
|
.. include:: ../example/tutorial/introduction-15.log
|
281
260
|
.. select --table Site --sortby -_id
|
282
261
|
|
283
|
-
|
262
|
+
You can use the '_score' column as a sorting criteria for ranking a search result.
|
284
263
|
|
285
264
|
.. groonga-command
|
286
265
|
.. include:: ../example/tutorial/introduction-16.log
|
287
266
|
.. select --table Site --query title:@test --output_columns _id,_score,title --sortby _score
|
288
267
|
|
289
|
-
If you want to specify
|
268
|
+
If you want to specify more than one columns, please separate column names by commas. In such a case, a search result is sorted in order of the column values in the first column, and then records having the same values in the first column are sorted in order of the second column values.
|
290
269
|
|
291
270
|
.. groonga-command
|
292
271
|
.. include:: ../example/tutorial/introduction-17.log
|
@@ -294,4 +273,4 @@ If you want to specify some column names, you should use comma(,) between these
|
|
294
273
|
|
295
274
|
.. rubric:: footnote
|
296
275
|
|
297
|
-
.. [1]
|
276
|
+
.. [1] Currently, a 'match_columns' parameter is available iff there exists an inverted index for full text search. A 'match_columns' parameter for a regular column is not supported.
|