rroonga 1.0.1-x86-mingw32 → 1.1.0-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/NEWS.ja.rdoc +146 -0
- data/NEWS.rdoc +146 -0
- data/README.ja.rdoc +7 -5
- data/README.rdoc +6 -5
- data/Rakefile +170 -18
- data/benchmark/create-wikipedia-database.rb +212 -0
- data/benchmark/read-write-many-small-items.rb +0 -0
- data/benchmark/repeat-load.rb +213 -0
- data/benchmark/select.rb +1052 -0
- data/benchmark/write-many-small-items.rb +0 -0
- data/example/bookmark.rb +94 -91
- data/example/index-html.rb +0 -0
- data/ext/groonga/extconf.rb +6 -6
- data/ext/groonga/rb-grn-accessor.c +1 -1
- data/ext/groonga/rb-grn-array.c +1 -1
- data/ext/groonga/rb-grn-column.c +201 -10
- data/ext/groonga/rb-grn-context.c +119 -20
- data/ext/groonga/rb-grn-database.c +27 -4
- data/ext/groonga/rb-grn-exception.c +15 -0
- data/ext/groonga/rb-grn-expression.c +14 -10
- data/ext/groonga/rb-grn-hash.c +4 -4
- data/ext/groonga/rb-grn-index-column.c +10 -6
- data/ext/groonga/rb-grn-logger.c +2 -2
- data/ext/groonga/rb-grn-object.c +33 -29
- data/ext/groonga/{rb-grn-operation.c → rb-grn-operator.c} +89 -87
- data/ext/groonga/rb-grn-patricia-trie.c +12 -12
- data/ext/groonga/rb-grn-plugin.c +134 -0
- data/ext/groonga/rb-grn-procedure.c +1 -1
- data/ext/groonga/rb-grn-query.c +7 -7
- data/ext/groonga/rb-grn-snippet.c +4 -3
- data/ext/groonga/rb-grn-table-cursor.c +1 -1
- data/ext/groonga/rb-grn-table-key-support.c +27 -24
- data/ext/groonga/rb-grn-table.c +119 -58
- data/ext/groonga/rb-grn-type.c +1 -1
- data/ext/groonga/rb-grn-utils.c +20 -19
- data/ext/groonga/rb-grn-variable.c +1 -1
- data/ext/groonga/rb-grn-view-accessor.c +1 -1
- data/ext/groonga/rb-grn-view.c +1 -1
- data/ext/groonga/rb-grn.h +26 -20
- data/ext/groonga/rb-groonga.c +6 -4
- data/extconf.rb +10 -4
- data/html/developer.html +8 -2
- data/html/favicon.ico +0 -0
- data/html/favicon.svg +591 -0
- data/html/index.html +78 -12
- data/html/logo.svg +612 -0
- data/html/ranguba.css +92 -7
- data/html/readme.svg +256 -0
- data/lib/groonga.so +0 -0
- data/lib/groonga/context.rb +52 -1
- data/lib/groonga/expression-builder.rb +42 -6
- data/lib/groonga/record.rb +84 -15
- data/lib/groonga/schema.rb +524 -122
- data/pkg/rroonga-1.1.0-x86-mingw32/NEWS.ja.rdoc +326 -0
- data/pkg/rroonga-1.1.0-x86-mingw32/NEWS.rdoc +328 -0
- data/pkg/rroonga-1.1.0-x86-mingw32/README.ja.rdoc +68 -0
- data/pkg/rroonga-1.1.0-x86-mingw32/README.rdoc +68 -0
- data/pkg/rroonga-1.1.0-x86-mingw32/text/expression.rdoc +285 -0
- data/{text/TUTORIAL.ja.rdoc → pkg/rroonga-1.1.0-x86-mingw32/text/tutorial.ja.rdoc} +165 -126
- data/pkg/rroonga-1.1.0/NEWS.ja.rdoc +326 -0
- data/pkg/rroonga-1.1.0/NEWS.rdoc +328 -0
- data/pkg/rroonga-1.1.0/README.ja.rdoc +68 -0
- data/pkg/rroonga-1.1.0/README.rdoc +68 -0
- data/pkg/rroonga-1.1.0/text/expression.rdoc +285 -0
- data/pkg/rroonga-1.1.0/text/tutorial.ja.rdoc +433 -0
- data/rroonga-build.rb +3 -3
- data/test/run-test.rb +1 -1
- data/test/test-array.rb +4 -0
- data/test/test-column.rb +31 -1
- data/test/test-context-select.rb +45 -14
- data/test/test-context.rb +44 -0
- data/test/test-database.rb +21 -1
- data/test/test-expression-builder.rb +46 -5
- data/test/test-fix-size-column.rb +12 -0
- data/test/test-hash.rb +10 -4
- data/test/test-index-column.rb +33 -0
- data/test/test-patricia-trie.rb +6 -0
- data/test/test-plugin.rb +29 -0
- data/test/test-record.rb +84 -1
- data/test/test-remote.rb +3 -2
- data/test/test-schema-create-table.rb +32 -2
- data/test/test-schema-type.rb +167 -0
- data/test/test-schema.rb +159 -12
- data/test/test-table-select-weight.rb +20 -1
- data/test/test-table-select.rb +12 -0
- data/test/test-table.rb +65 -0
- data/test/test-variable-size-column.rb +12 -0
- data/text/tutorial.ja.rdoc +433 -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/etc/groonga/init.d/redhat/groonga +1 -9
- data/vendor/local/include/groonga/groonga.h +156 -6
- data/vendor/local/include/groonga/groonga/plugin.h +44 -0
- data/vendor/local/lib/groonga/plugins/suggest/suggest.a +0 -0
- data/vendor/local/lib/groonga/plugins/suggest/suggest.dll +0 -0
- data/vendor/local/lib/groonga/plugins/suggest/suggest.dll.a +0 -0
- data/vendor/local/lib/groonga/{modules → plugins}/suggest/suggest.la +2 -2
- data/vendor/local/lib/libgroonga.a +0 -0
- data/vendor/local/lib/libgroonga.dll.a +0 -0
- data/vendor/local/lib/libgroonga.la +1 -1
- data/vendor/local/lib/pkgconfig/groonga.pc +3 -2
- data/vendor/local/share/groonga/examples/dictionary/edict/edict_import.sh +14 -3
- data/vendor/local/share/groonga/examples/dictionary/eijiro/eijiro_import.sh +3 -1
- data/vendor/local/share/groonga/examples/dictionary/gene95/gene_import.sh +19 -3
- data/vendor/local/share/groonga/munin/plugins/groonga_cpu_load +0 -0
- data/vendor/local/share/groonga/munin/plugins/groonga_cpu_time +0 -0
- data/vendor/local/share/groonga/munin/plugins/groonga_disk +0 -0
- data/vendor/local/share/groonga/munin/plugins/groonga_memory +0 -0
- data/vendor/local/share/groonga/munin/plugins/groonga_n_records +0 -0
- data/vendor/local/share/groonga/munin/plugins/groonga_query_performance +0 -0
- data/vendor/local/share/groonga/munin/plugins/groonga_status +0 -0
- metadata +91 -341
- data/html/favicon.xcf +0 -0
- data/html/logo.xcf +0 -0
- data/lib/1.8/groonga.so +0 -0
- data/lib/1.9/groonga.so +0 -0
- data/license/GPL +0 -340
- data/license/RUBY +0 -59
- data/vendor/local/lib/groonga/modules/suggest/suggest.a +0 -0
- data/vendor/local/lib/groonga/modules/suggest/suggest.dll +0 -0
- data/vendor/local/lib/groonga/modules/suggest/suggest.dll.a +0 -0
- data/vendor/local/share/groonga/doc/ja/html/.buildinfo +0 -4
- data/vendor/local/share/groonga/doc/ja/html/_sources/characteristic.txt +0 -56
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands.txt +0 -10
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/cache_limit.txt +0 -52
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/check.txt +0 -164
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/clearlock.txt +0 -61
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/column_create.txt +0 -93
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/column_list.txt +0 -97
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/column_remove.txt +0 -58
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/define_selector.txt +0 -114
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/defrag.txt +0 -57
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/delete.txt +0 -68
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/dump.txt +0 -62
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/load.txt +0 -98
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/log_level.txt +0 -65
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/log_put.txt +0 -69
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/log_reopen.txt +0 -66
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/quit.txt +0 -38
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/select.txt +0 -247
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/shutdown.txt +0 -38
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/status.txt +0 -59
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/suggest.txt +0 -79
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/table_create.txt +0 -111
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/table_list.txt +0 -87
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/table_remove.txt +0 -50
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands/view_add.txt +0 -53
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands_not_implemented/add.txt +0 -102
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands_not_implemented/get.txt +0 -78
- data/vendor/local/share/groonga/doc/ja/html/_sources/commands_not_implemented/set.txt +0 -103
- data/vendor/local/share/groonga/doc/ja/html/_sources/developer.txt +0 -10
- data/vendor/local/share/groonga/doc/ja/html/_sources/developer/com.txt +0 -18
- data/vendor/local/share/groonga/doc/ja/html/_sources/developer/document.txt +0 -38
- data/vendor/local/share/groonga/doc/ja/html/_sources/developer/query.txt +0 -212
- data/vendor/local/share/groonga/doc/ja/html/_sources/developer/test.txt +0 -114
- data/vendor/local/share/groonga/doc/ja/html/_sources/execfile.txt +0 -226
- data/vendor/local/share/groonga/doc/ja/html/_sources/expr.txt +0 -43
- data/vendor/local/share/groonga/doc/ja/html/_sources/functions.txt +0 -10
- data/vendor/local/share/groonga/doc/ja/html/_sources/functions/edit_distance.txt +0 -48
- data/vendor/local/share/groonga/doc/ja/html/_sources/functions/geo_distance.txt +0 -51
- data/vendor/local/share/groonga/doc/ja/html/_sources/functions/geo_in_circle.txt +0 -54
- data/vendor/local/share/groonga/doc/ja/html/_sources/functions/geo_in_rectangle.txt +0 -55
- data/vendor/local/share/groonga/doc/ja/html/_sources/functions/now.txt +0 -34
- data/vendor/local/share/groonga/doc/ja/html/_sources/functions/rand.txt +0 -41
- data/vendor/local/share/groonga/doc/ja/html/_sources/grnslap.txt +0 -64
- data/vendor/local/share/groonga/doc/ja/html/_sources/grntest.txt +0 -259
- data/vendor/local/share/groonga/doc/ja/html/_sources/http.txt +0 -52
- data/vendor/local/share/groonga/doc/ja/html/_sources/index.txt +0 -21
- data/vendor/local/share/groonga/doc/ja/html/_sources/install.txt +0 -114
- data/vendor/local/share/groonga/doc/ja/html/_sources/news.txt +0 -199
- data/vendor/local/share/groonga/doc/ja/html/_sources/process.txt +0 -12
- data/vendor/local/share/groonga/doc/ja/html/_sources/pseudo_column.txt +0 -38
- data/vendor/local/share/groonga/doc/ja/html/_sources/reference.txt +0 -14
- data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial.txt +0 -10
- data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial01.txt +0 -293
- data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial02.txt +0 -100
- data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial03.txt +0 -72
- data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial04.txt +0 -111
- data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial05.txt +0 -65
- data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial06.txt +0 -91
- data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial07.txt +0 -92
- data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial08.txt +0 -53
- data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial09.txt +0 -9
- data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial10.txt +0 -486
- data/vendor/local/share/groonga/doc/ja/html/_sources/type.txt +0 -118
- data/vendor/local/share/groonga/doc/ja/html/_static/basic.css +0 -509
- data/vendor/local/share/groonga/doc/ja/html/_static/default.css +0 -277
- data/vendor/local/share/groonga/doc/ja/html/_static/doctools.js +0 -247
- data/vendor/local/share/groonga/doc/ja/html/_static/file.png +0 -0
- data/vendor/local/share/groonga/doc/ja/html/_static/jquery.js +0 -6240
- data/vendor/local/share/groonga/doc/ja/html/_static/minus.png +0 -0
- data/vendor/local/share/groonga/doc/ja/html/_static/plus.png +0 -0
- data/vendor/local/share/groonga/doc/ja/html/_static/pygments.css +0 -61
- data/vendor/local/share/groonga/doc/ja/html/_static/searchtools.js +0 -518
- data/vendor/local/share/groonga/doc/ja/html/_static/sidebar.js +0 -147
- data/vendor/local/share/groonga/doc/ja/html/_static/underscore.js +0 -16
- data/vendor/local/share/groonga/doc/ja/html/characteristic.html +0 -162
- data/vendor/local/share/groonga/doc/ja/html/commands.html +0 -139
- data/vendor/local/share/groonga/doc/ja/html/commands/cache_limit.html +0 -173
- data/vendor/local/share/groonga/doc/ja/html/commands/check.html +0 -285
- data/vendor/local/share/groonga/doc/ja/html/commands/clearlock.html +0 -180
- data/vendor/local/share/groonga/doc/ja/html/commands/column_create.html +0 -210
- data/vendor/local/share/groonga/doc/ja/html/commands/column_list.html +0 -220
- data/vendor/local/share/groonga/doc/ja/html/commands/column_remove.html +0 -183
- data/vendor/local/share/groonga/doc/ja/html/commands/define_selector.html +0 -221
- data/vendor/local/share/groonga/doc/ja/html/commands/defrag.html +0 -177
- data/vendor/local/share/groonga/doc/ja/html/commands/delete.html +0 -182
- data/vendor/local/share/groonga/doc/ja/html/commands/dump.html +0 -177
- data/vendor/local/share/groonga/doc/ja/html/commands/load.html +0 -208
- data/vendor/local/share/groonga/doc/ja/html/commands/log_level.html +0 -187
- data/vendor/local/share/groonga/doc/ja/html/commands/log_put.html +0 -190
- data/vendor/local/share/groonga/doc/ja/html/commands/log_reopen.html +0 -188
- data/vendor/local/share/groonga/doc/ja/html/commands/quit.html +0 -156
- data/vendor/local/share/groonga/doc/ja/html/commands/select.html +0 -331
- data/vendor/local/share/groonga/doc/ja/html/commands/shutdown.html +0 -156
- data/vendor/local/share/groonga/doc/ja/html/commands/status.html +0 -179
- data/vendor/local/share/groonga/doc/ja/html/commands/suggest.html +0 -191
- data/vendor/local/share/groonga/doc/ja/html/commands/table_create.html +0 -222
- data/vendor/local/share/groonga/doc/ja/html/commands/table_list.html +0 -202
- data/vendor/local/share/groonga/doc/ja/html/commands/table_remove.html +0 -173
- data/vendor/local/share/groonga/doc/ja/html/commands/view_add.html +0 -175
- data/vendor/local/share/groonga/doc/ja/html/commands_not_implemented/add.html +0 -180
- data/vendor/local/share/groonga/doc/ja/html/commands_not_implemented/get.html +0 -161
- data/vendor/local/share/groonga/doc/ja/html/commands_not_implemented/set.html +0 -182
- data/vendor/local/share/groonga/doc/ja/html/developer.html +0 -118
- data/vendor/local/share/groonga/doc/ja/html/developer/com.html +0 -136
- data/vendor/local/share/groonga/doc/ja/html/developer/document.html +0 -159
- data/vendor/local/share/groonga/doc/ja/html/developer/query.html +0 -336
- data/vendor/local/share/groonga/doc/ja/html/developer/test.html +0 -220
- data/vendor/local/share/groonga/doc/ja/html/execfile.html +0 -370
- data/vendor/local/share/groonga/doc/ja/html/expr.html +0 -157
- data/vendor/local/share/groonga/doc/ja/html/functions.html +0 -122
- data/vendor/local/share/groonga/doc/ja/html/functions/edit_distance.html +0 -162
- data/vendor/local/share/groonga/doc/ja/html/functions/geo_distance.html +0 -170
- data/vendor/local/share/groonga/doc/ja/html/functions/geo_in_circle.html +0 -173
- data/vendor/local/share/groonga/doc/ja/html/functions/geo_in_rectangle.html +0 -172
- data/vendor/local/share/groonga/doc/ja/html/functions/now.html +0 -152
- data/vendor/local/share/groonga/doc/ja/html/functions/rand.html +0 -159
- data/vendor/local/share/groonga/doc/ja/html/genindex.html +0 -227
- data/vendor/local/share/groonga/doc/ja/html/grnslap.html +0 -183
- data/vendor/local/share/groonga/doc/ja/html/grntest.html +0 -368
- data/vendor/local/share/groonga/doc/ja/html/http.html +0 -163
- data/vendor/local/share/groonga/doc/ja/html/index.html +0 -291
- data/vendor/local/share/groonga/doc/ja/html/install.html +0 -228
- data/vendor/local/share/groonga/doc/ja/html/news.html +0 -310
- data/vendor/local/share/groonga/doc/ja/html/objects.inv +0 -0
- data/vendor/local/share/groonga/doc/ja/html/process.html +0 -120
- data/vendor/local/share/groonga/doc/ja/html/pseudo_column.html +0 -147
- data/vendor/local/share/groonga/doc/ja/html/reference.html +0 -174
- data/vendor/local/share/groonga/doc/ja/html/search.html +0 -96
- data/vendor/local/share/groonga/doc/ja/html/searchindex.js +0 -1
- data/vendor/local/share/groonga/doc/ja/html/tutorial.html +0 -172
- data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial01.html +0 -388
- data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial02.html +0 -214
- data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial03.html +0 -183
- data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial04.html +0 -212
- data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial05.html +0 -169
- data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial06.html +0 -209
- data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial07.html +0 -212
- data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial08.html +0 -139
- data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial09.html +0 -114
- data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial10.html +0 -458
- data/vendor/local/share/groonga/doc/ja/html/type.html +0 -217
- data/vendor/local/share/groonga/doc/ja/source/__init__.py +0 -0
- data/vendor/local/share/groonga/doc/ja/source/characteristic.txt +0 -56
- data/vendor/local/share/groonga/doc/ja/source/commands.txt +0 -10
- data/vendor/local/share/groonga/doc/ja/source/commands/cache_limit.txt +0 -52
- data/vendor/local/share/groonga/doc/ja/source/commands/check.txt +0 -164
- data/vendor/local/share/groonga/doc/ja/source/commands/clearlock.txt +0 -61
- data/vendor/local/share/groonga/doc/ja/source/commands/column_create.txt +0 -93
- data/vendor/local/share/groonga/doc/ja/source/commands/column_list.txt +0 -97
- data/vendor/local/share/groonga/doc/ja/source/commands/column_remove.txt +0 -58
- data/vendor/local/share/groonga/doc/ja/source/commands/define_selector.txt +0 -114
- data/vendor/local/share/groonga/doc/ja/source/commands/defrag.txt +0 -57
- data/vendor/local/share/groonga/doc/ja/source/commands/delete.txt +0 -68
- data/vendor/local/share/groonga/doc/ja/source/commands/dump.txt +0 -62
- data/vendor/local/share/groonga/doc/ja/source/commands/load.txt +0 -98
- data/vendor/local/share/groonga/doc/ja/source/commands/log_level.txt +0 -65
- data/vendor/local/share/groonga/doc/ja/source/commands/log_put.txt +0 -69
- data/vendor/local/share/groonga/doc/ja/source/commands/log_reopen.txt +0 -66
- data/vendor/local/share/groonga/doc/ja/source/commands/quit.txt +0 -38
- data/vendor/local/share/groonga/doc/ja/source/commands/select.txt +0 -247
- data/vendor/local/share/groonga/doc/ja/source/commands/shutdown.txt +0 -38
- data/vendor/local/share/groonga/doc/ja/source/commands/status.txt +0 -59
- data/vendor/local/share/groonga/doc/ja/source/commands/table_create.txt +0 -111
- data/vendor/local/share/groonga/doc/ja/source/commands/table_list.txt +0 -87
- data/vendor/local/share/groonga/doc/ja/source/commands/table_remove.txt +0 -50
- data/vendor/local/share/groonga/doc/ja/source/commands/view_add.txt +0 -53
- data/vendor/local/share/groonga/doc/ja/source/commands_not_implemented/add.txt +0 -102
- data/vendor/local/share/groonga/doc/ja/source/commands_not_implemented/get.txt +0 -78
- data/vendor/local/share/groonga/doc/ja/source/commands_not_implemented/set.txt +0 -103
- data/vendor/local/share/groonga/doc/ja/source/conf.py +0 -265
- data/vendor/local/share/groonga/doc/ja/source/developer.txt +0 -10
- data/vendor/local/share/groonga/doc/ja/source/developer/com.txt +0 -18
- data/vendor/local/share/groonga/doc/ja/source/developer/document.txt +0 -38
- data/vendor/local/share/groonga/doc/ja/source/developer/query.txt +0 -212
- data/vendor/local/share/groonga/doc/ja/source/developer/test.txt +0 -114
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-1.log +0 -6
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-10.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-11.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-12.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-13.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-14.log +0 -9
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-15.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-16.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-17.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-2.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-3.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-4.log +0 -7
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-5.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-6.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-7.log +0 -16
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-8.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-9.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial02-1.log +0 -8
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial02-2.log +0 -6
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial02-3.log +0 -12
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial03-1.log +0 -18
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial03-2.log +0 -10
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial03-3.log +0 -10
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial04-1.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial04-2.log +0 -7
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial04-3.log +0 -7
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial04-4.log +0 -13
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial04-5.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial04-6.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial04-7.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial05-1.log +0 -24
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial05-2.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial05-3.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial05-4.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial05-5.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial05-6.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial06-1.log +0 -25
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial06-2.log +0 -9
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial06-3.log +0 -21
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial06-4.log +0 -7
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial06-5.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial07-1.log +0 -22
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial07-2.log +0 -9
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial07-3.log +0 -20
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial07-4.log +0 -9
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial08-1.log +0 -14
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-1.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-10.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-2.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-3.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-4.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-5.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-6.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-7.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-8.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-9.log +0 -5
- data/vendor/local/share/groonga/doc/ja/source/execfile.txt +0 -226
- data/vendor/local/share/groonga/doc/ja/source/expr.txt +0 -43
- data/vendor/local/share/groonga/doc/ja/source/functions.txt +0 -10
- data/vendor/local/share/groonga/doc/ja/source/functions/edit_distance.txt +0 -48
- data/vendor/local/share/groonga/doc/ja/source/functions/geo_distance.txt +0 -51
- data/vendor/local/share/groonga/doc/ja/source/functions/geo_in_circle.txt +0 -54
- data/vendor/local/share/groonga/doc/ja/source/functions/geo_in_rectangle.txt +0 -55
- data/vendor/local/share/groonga/doc/ja/source/functions/now.txt +0 -34
- data/vendor/local/share/groonga/doc/ja/source/functions/rand.txt +0 -41
- data/vendor/local/share/groonga/doc/ja/source/grnslap.txt +0 -64
- data/vendor/local/share/groonga/doc/ja/source/grntest.txt +0 -259
- data/vendor/local/share/groonga/doc/ja/source/http.txt +0 -52
- data/vendor/local/share/groonga/doc/ja/source/index.txt +0 -21
- data/vendor/local/share/groonga/doc/ja/source/install.txt +0 -114
- data/vendor/local/share/groonga/doc/ja/source/news.txt +0 -199
- data/vendor/local/share/groonga/doc/ja/source/process.txt +0 -12
- data/vendor/local/share/groonga/doc/ja/source/pseudo_column.txt +0 -38
- data/vendor/local/share/groonga/doc/ja/source/rdoc.py +0 -762
- data/vendor/local/share/groonga/doc/ja/source/reference.txt +0 -14
- data/vendor/local/share/groonga/doc/ja/source/tutorial.txt +0 -10
- data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial01.txt +0 -293
- data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial02.txt +0 -100
- data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial03.txt +0 -72
- data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial04.txt +0 -111
- data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial05.txt +0 -65
- data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial06.txt +0 -91
- data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial07.txt +0 -92
- data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial08.txt +0 -53
- data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial09.txt +0 -9
- data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial10.txt +0 -486
- data/vendor/local/share/groonga/doc/ja/source/type.txt +0 -118
- data/vendor/local/share/groonga/doc/ja/source/update_execution_example.py +0 -113
- data/vendor/local/share/man/man1/groonga.1 +0 -5498
@@ -90,7 +90,7 @@ VALUE rb_cGrnPatriciaTrie;
|
|
90
90
|
* ともでき、その場合は自動的にGroonga::Recordからレコード
|
91
91
|
* IDを取得する。
|
92
92
|
*
|
93
|
-
*
|
93
|
+
* 省略した場合はShortText型をキーとして使用する。この場合、
|
94
94
|
* 4096バイトまで使用可能である。
|
95
95
|
*
|
96
96
|
* [+:value_type+]
|
@@ -206,7 +206,7 @@ rb_grn_patricia_trie_s_create (int argc, VALUE *argv, VALUE klass)
|
|
206
206
|
flags |= GRN_OBJ_KEY_WITH_SIS;
|
207
207
|
|
208
208
|
if (NIL_P(rb_key_type)) {
|
209
|
-
|
209
|
+
key_type = grn_ctx_at(context, GRN_DB_SHORT_TEXT);
|
210
210
|
} else {
|
211
211
|
key_type = RVAL2GRNOBJECT(rb_key_type, &context);
|
212
212
|
}
|
@@ -221,7 +221,7 @@ rb_grn_patricia_trie_s_create (int argc, VALUE *argv, VALUE klass)
|
|
221
221
|
flags, key_type, value_type);
|
222
222
|
if (!table)
|
223
223
|
rb_grn_context_check(context, rb_ary_new4(argc, argv));
|
224
|
-
rb_table = GRNOBJECT2RVAL(klass, context, table,
|
224
|
+
rb_table = GRNOBJECT2RVAL(klass, context, table, GRN_TRUE);
|
225
225
|
|
226
226
|
if (!NIL_P(rb_default_tokenizer))
|
227
227
|
rb_funcall(rb_table, rb_intern("default_tokenizer="), 1,
|
@@ -252,17 +252,17 @@ rb_grn_patricia_trie_s_create (int argc, VALUE *argv, VALUE klass)
|
|
252
252
|
*
|
253
253
|
* [+:operator+]
|
254
254
|
* マッチしたレコードをどのように扱うか。指定可能な値は以
|
255
|
-
* 下の通り。省略した場合はGroonga::
|
255
|
+
* 下の通り。省略した場合はGroonga::Operator::OR。
|
256
256
|
*
|
257
|
-
* [Groonga::
|
257
|
+
* [Groonga::Operator::OR]
|
258
258
|
* マッチしたレコードを追加。すでにレコードが追加され
|
259
259
|
* ている場合は何もしない。
|
260
|
-
* [Groonga::
|
260
|
+
* [Groonga::Operator::AND]
|
261
261
|
* マッチしたレコードのスコアを増加。マッチしなかった
|
262
262
|
* レコードを削除。
|
263
|
-
* [Groonga::
|
263
|
+
* [Groonga::Operator::BUT]
|
264
264
|
* マッチしたレコードを削除。
|
265
|
-
* [Groonga::
|
265
|
+
* [Groonga::Operator::ADJUST]
|
266
266
|
* マッチしたレコードのスコアを増加。
|
267
267
|
*
|
268
268
|
* [+:type+]
|
@@ -289,7 +289,7 @@ rb_grn_patricia_trie_search (int argc, VALUE *argv, VALUE self)
|
|
289
289
|
grn_obj *key, *domain, *result;
|
290
290
|
grn_operator operator;
|
291
291
|
grn_search_optarg search_options;
|
292
|
-
|
292
|
+
grn_bool search_options_is_set = GRN_FALSE;
|
293
293
|
VALUE rb_key, options, rb_result, rb_operator, rb_type;
|
294
294
|
|
295
295
|
rb_grn_table_key_support_deconstruct(SELF(self), &table, &context,
|
@@ -312,7 +312,7 @@ rb_grn_patricia_trie_search (int argc, VALUE *argv, VALUE self)
|
|
312
312
|
GRN_OBJ_TABLE_HASH_KEY | GRN_OBJ_WITH_SUBREC,
|
313
313
|
table, 0);
|
314
314
|
rb_grn_context_check(context, self);
|
315
|
-
rb_result = GRNOBJECT2RVAL(Qnil, context, result,
|
315
|
+
rb_result = GRNOBJECT2RVAL(Qnil, context, result, GRN_TRUE);
|
316
316
|
} else {
|
317
317
|
result = RVAL2GRNOBJECT(rb_result, &context);
|
318
318
|
}
|
@@ -381,7 +381,7 @@ rb_grn_patricia_trie_scan (VALUE self, VALUE rb_string)
|
|
381
381
|
grn_pat_scan_hit hits[1024];
|
382
382
|
const char *string;
|
383
383
|
long string_length;
|
384
|
-
|
384
|
+
grn_bool block_given;
|
385
385
|
|
386
386
|
string = StringValuePtr(rb_string);
|
387
387
|
string_length = RSTRING_LEN(rb_string);
|
@@ -459,7 +459,7 @@ rb_grn_patricia_trie_prefix_search (VALUE self, VALUE rb_prefix)
|
|
459
459
|
GRN_OBJ_TABLE_HASH_KEY,
|
460
460
|
table, 0);
|
461
461
|
rb_grn_context_check(context, self);
|
462
|
-
rb_result = GRNOBJECT2RVAL(Qnil, context, result,
|
462
|
+
rb_result = GRNOBJECT2RVAL(Qnil, context, result, GRN_TRUE);
|
463
463
|
|
464
464
|
GRN_BULK_REWIND(key);
|
465
465
|
RVAL2GRNKEY(rb_prefix, context, key, domain_id, domain, self);
|
@@ -0,0 +1,134 @@
|
|
1
|
+
/* -*- c-file-style: "ruby" -*- */
|
2
|
+
/*
|
3
|
+
Copyright (C) 2011 Kouhei Sutou <kou@clear-code.com>
|
4
|
+
|
5
|
+
This library is free software; you can redistribute it and/or
|
6
|
+
modify it under the terms of the GNU Lesser General Public
|
7
|
+
License version 2.1 as published by the Free Software Foundation.
|
8
|
+
|
9
|
+
This library is distributed in the hope that it will be useful,
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
12
|
+
Lesser General Public License for more details.
|
13
|
+
|
14
|
+
You should have received a copy of the GNU Lesser General Public
|
15
|
+
License along with this library; if not, write to the Free Software
|
16
|
+
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
17
|
+
*/
|
18
|
+
|
19
|
+
#include "rb-grn.h"
|
20
|
+
|
21
|
+
#define SELF(object) (RVAL2GRNCONTEXT(object))
|
22
|
+
|
23
|
+
static VALUE cGrnPlugin;
|
24
|
+
|
25
|
+
/*
|
26
|
+
* Document-class: Groonga::Plugin
|
27
|
+
*
|
28
|
+
* プラグイン。現在のところ、Rubyでgroongaのプラグインを作成
|
29
|
+
* することはできず、Cで作成された既存のプラグインを登録する
|
30
|
+
* ことができるだけです。
|
31
|
+
*/
|
32
|
+
|
33
|
+
grn_id
|
34
|
+
rb_grn_plugin_from_ruby_object (VALUE object)
|
35
|
+
{
|
36
|
+
RbGrnPlugin *rb_grn_plugin;
|
37
|
+
|
38
|
+
if (!RVAL2CBOOL(rb_obj_is_kind_of(object, cGrnPlugin))) {
|
39
|
+
rb_raise(rb_eTypeError, "not a groonga plugin");
|
40
|
+
}
|
41
|
+
|
42
|
+
Data_Get_Struct(object, RbGrnPlugin, rb_grn_plugin);
|
43
|
+
if (!rb_grn_plugin)
|
44
|
+
rb_raise(rb_eGrnError, "groonga plugin is NULL");
|
45
|
+
return rb_grn_plugin->id;
|
46
|
+
}
|
47
|
+
|
48
|
+
void
|
49
|
+
rb_grn_plugin_fin (grn_id id)
|
50
|
+
{
|
51
|
+
}
|
52
|
+
|
53
|
+
static void
|
54
|
+
rb_grn_plugin_free (void *pointer)
|
55
|
+
{
|
56
|
+
RbGrnPlugin *rb_grn_plugin = pointer;
|
57
|
+
|
58
|
+
xfree(rb_grn_plugin);
|
59
|
+
}
|
60
|
+
|
61
|
+
static VALUE
|
62
|
+
rb_grn_plugin_alloc (VALUE klass)
|
63
|
+
{
|
64
|
+
return Data_Wrap_Struct(klass, NULL, rb_grn_plugin_free, NULL);
|
65
|
+
}
|
66
|
+
|
67
|
+
/*
|
68
|
+
* call-seq:
|
69
|
+
* Groonga::Plugin.register(name, options=nil)
|
70
|
+
* Groonga::Plugin.register({:path => path, :context => nil})
|
71
|
+
*
|
72
|
+
* 既存のプラグインをデータベースに登録する。
|
73
|
+
*
|
74
|
+
* _name_を指定した場合はその名前のプラグインを登録する。
|
75
|
+
*
|
76
|
+
* _path_を指定した場合はそのパスのプラグインを登録する。
|
77
|
+
*
|
78
|
+
* _options_にはハッシュでオプションを指定する。指定できるオ
|
79
|
+
* プションは以下の通り。
|
80
|
+
*
|
81
|
+
* [+:context+]
|
82
|
+
* データベースを結びつけるコンテキスト。省略すると
|
83
|
+
* Groonga::Context.defaultを利用する。
|
84
|
+
*/
|
85
|
+
static VALUE
|
86
|
+
rb_grn_plugin_s_register (int argc, VALUE *argv, VALUE klass)
|
87
|
+
{
|
88
|
+
const char *name = NULL, *path = NULL;
|
89
|
+
VALUE rb_options, rb_name = Qnil, rb_path, rb_context;
|
90
|
+
grn_ctx *context;
|
91
|
+
|
92
|
+
if (argc >= 1) {
|
93
|
+
rb_name = rb_check_string_type(argv[0]);
|
94
|
+
}
|
95
|
+
|
96
|
+
if (NIL_P(rb_name)) {
|
97
|
+
rb_scan_args(argc, argv, "01", &rb_options);
|
98
|
+
rb_grn_scan_options(rb_options,
|
99
|
+
"path", &rb_path,
|
100
|
+
"context", &rb_context,
|
101
|
+
NULL);
|
102
|
+
path = StringValueCStr(rb_path);
|
103
|
+
} else {
|
104
|
+
rb_scan_args(argc, argv, "11", &rb_name, &rb_options);
|
105
|
+
rb_grn_scan_options(rb_options,
|
106
|
+
"context", &rb_context,
|
107
|
+
NULL);
|
108
|
+
name = StringValueCStr(rb_name);
|
109
|
+
}
|
110
|
+
|
111
|
+
if (NIL_P(rb_context)) {
|
112
|
+
rb_context = rb_grn_context_get_default();
|
113
|
+
}
|
114
|
+
context = RVAL2GRNCONTEXT(rb_context);
|
115
|
+
|
116
|
+
if (name) {
|
117
|
+
grn_plugin_register(context, name);
|
118
|
+
} else {
|
119
|
+
grn_plugin_register_by_path(context, path);
|
120
|
+
}
|
121
|
+
|
122
|
+
rb_grn_context_check(context, rb_ary_new4(argc, argv));
|
123
|
+
return Qnil;
|
124
|
+
}
|
125
|
+
|
126
|
+
void
|
127
|
+
rb_grn_init_plugin (VALUE mGrn)
|
128
|
+
{
|
129
|
+
cGrnPlugin = rb_define_class_under(mGrn, "Plugin", rb_cObject);
|
130
|
+
rb_define_alloc_func(cGrnPlugin, rb_grn_plugin_alloc);
|
131
|
+
|
132
|
+
rb_define_singleton_method(cGrnPlugin, "register",
|
133
|
+
rb_grn_plugin_s_register, -1);
|
134
|
+
}
|
data/ext/groonga/rb-grn-query.c
CHANGED
@@ -34,7 +34,7 @@ struct _RbGrnQuery
|
|
34
34
|
{
|
35
35
|
grn_ctx *context;
|
36
36
|
grn_query *query;
|
37
|
-
|
37
|
+
grn_bool owner;
|
38
38
|
};
|
39
39
|
|
40
40
|
VALUE rb_cGrnQuery;
|
@@ -86,7 +86,7 @@ rb_grn_query_to_ruby_object (grn_ctx *context, grn_query *query)
|
|
86
86
|
rb_grn_query = ALLOC(RbGrnQuery);
|
87
87
|
rb_grn_query->context = context;
|
88
88
|
rb_grn_query->query = query;
|
89
|
-
rb_grn_query->owner =
|
89
|
+
rb_grn_query->owner = GRN_FALSE;
|
90
90
|
|
91
91
|
return Data_Wrap_Struct(rb_cGrnQuery, NULL,
|
92
92
|
rb_rb_grn_query_free, rb_grn_query);
|
@@ -146,10 +146,10 @@ rb_grn_operator_from_ruby_object (VALUE rb_operator)
|
|
146
146
|
* 演算子の既定値(演算子を省略した場合にどの演算を行うか)
|
147
147
|
* を指定する。
|
148
148
|
*
|
149
|
-
* [Groonga::
|
150
|
-
* [Groonga::
|
151
|
-
* [Groonga::
|
152
|
-
* [Groonga::
|
149
|
+
* [Groonga::Operator::OR]
|
150
|
+
* [Groonga::Operator::AND]
|
151
|
+
* [Groonga::Operator::BUT]
|
152
|
+
* [Groonga::Operator::ADJUST]
|
153
153
|
* (FIXME: 挙動の違いを検証する必要性あり?
|
154
154
|
* Groonga::Expressionとの関連性は?)
|
155
155
|
*
|
@@ -195,7 +195,7 @@ rb_grn_query_initialize (int argc, VALUE *argv, VALUE self)
|
|
195
195
|
DATA_PTR(self) = rb_grn_query;
|
196
196
|
rb_grn_query->context = context;
|
197
197
|
rb_grn_query->query = query;
|
198
|
-
rb_grn_query->owner =
|
198
|
+
rb_grn_query->owner = GRN_TRUE;
|
199
199
|
|
200
200
|
rb_iv_set(self, "@context", rb_context);
|
201
201
|
|
@@ -25,7 +25,7 @@ struct _RbGrnSnippet
|
|
25
25
|
{
|
26
26
|
grn_ctx *context;
|
27
27
|
grn_snip *snippet;
|
28
|
-
|
28
|
+
grn_bool owner;
|
29
29
|
};
|
30
30
|
|
31
31
|
VALUE rb_cGrnSnippet;
|
@@ -76,7 +76,7 @@ rb_rb_grn_snippet_free (void *object)
|
|
76
76
|
|
77
77
|
VALUE
|
78
78
|
rb_grn_snippet_to_ruby_object (grn_ctx *context, grn_snip *snippet,
|
79
|
-
|
79
|
+
grn_bool owner)
|
80
80
|
{
|
81
81
|
RbGrnSnippet *rb_grn_snippet;
|
82
82
|
|
@@ -201,7 +201,7 @@ rb_grn_snippet_initialize (int argc, VALUE *argv, VALUE self)
|
|
201
201
|
DATA_PTR(self) = rb_grn_snippet;
|
202
202
|
rb_grn_snippet->context = context;
|
203
203
|
rb_grn_snippet->snippet = snippet;
|
204
|
-
rb_grn_snippet->owner =
|
204
|
+
rb_grn_snippet->owner = GRN_TRUE;
|
205
205
|
|
206
206
|
rb_iv_set(self, "@context", rb_context);
|
207
207
|
|
@@ -302,6 +302,7 @@ rb_grn_snippet_execute (VALUE self, VALUE rb_string)
|
|
302
302
|
|
303
303
|
rc = grn_snip_exec(context, snippet, string, string_length,
|
304
304
|
&n_results, &max_tagged_length);
|
305
|
+
rb_grn_context_check(context, self);
|
305
306
|
rb_grn_rc_check(rc, self);
|
306
307
|
|
307
308
|
rb_results = rb_ary_new2(n_results);
|
@@ -42,7 +42,7 @@ rb_grn_table_cursor_from_ruby_object (VALUE object, grn_ctx **context)
|
|
42
42
|
VALUE
|
43
43
|
rb_grn_table_cursor_to_ruby_object (VALUE klass, grn_ctx *context,
|
44
44
|
grn_table_cursor *cursor,
|
45
|
-
|
45
|
+
grn_bool owner)
|
46
46
|
{
|
47
47
|
return GRNOBJECT2RVAL(klass, context, cursor, owner);
|
48
48
|
}
|
@@ -457,23 +457,6 @@ rb_grn_table_key_support_get_column_value (int argc, VALUE *argv, VALUE self)
|
|
457
457
|
return rb_grn_table_get_column_value_raw(self, id, rb_name);
|
458
458
|
}
|
459
459
|
|
460
|
-
/*
|
461
|
-
* call-seq:
|
462
|
-
* table.find(key) -> Groonga::Record
|
463
|
-
*
|
464
|
-
* テーブルの_key_に対応するレコードを返す。
|
465
|
-
*
|
466
|
-
* 0.9.0から非推奨。代わりにtable[key]を使うこと。
|
467
|
-
*/
|
468
|
-
static VALUE
|
469
|
-
rb_grn_table_key_support_find (VALUE self, VALUE rb_key)
|
470
|
-
{
|
471
|
-
rb_warn("#find is deprecated. Use #[] instead: %s",
|
472
|
-
rb_grn_inspect(self));
|
473
|
-
|
474
|
-
return rb_grn_table_key_support_array_reference(self, rb_key);
|
475
|
-
}
|
476
|
-
|
477
460
|
static VALUE
|
478
461
|
rb_grn_table_key_support_get_value_by_key (VALUE self, VALUE rb_key)
|
479
462
|
{
|
@@ -508,12 +491,12 @@ static VALUE
|
|
508
491
|
rb_grn_table_key_support_get_value (int argc, VALUE *argv, VALUE self)
|
509
492
|
{
|
510
493
|
VALUE rb_id_or_key, rb_options;
|
511
|
-
|
494
|
+
grn_bool use_key;
|
512
495
|
|
513
496
|
rb_scan_args(argc, argv, "11", &rb_id_or_key, &rb_options);
|
514
497
|
|
515
498
|
if (NIL_P(rb_options)) {
|
516
|
-
use_key =
|
499
|
+
use_key = GRN_TRUE;
|
517
500
|
} else {
|
518
501
|
VALUE rb_option_id;
|
519
502
|
|
@@ -579,12 +562,12 @@ static VALUE
|
|
579
562
|
rb_grn_table_key_support_set_value (int argc, VALUE *argv, VALUE self)
|
580
563
|
{
|
581
564
|
VALUE rb_id_or_key, rb_value, rb_options;
|
582
|
-
|
565
|
+
grn_bool use_key;
|
583
566
|
|
584
567
|
rb_scan_args(argc, argv, "21", &rb_id_or_key, &rb_value, &rb_options);
|
585
568
|
|
586
569
|
if (NIL_P(rb_options)) {
|
587
|
-
use_key =
|
570
|
+
use_key = GRN_TRUE;
|
588
571
|
} else {
|
589
572
|
VALUE rb_option_id;
|
590
573
|
|
@@ -625,7 +608,7 @@ rb_grn_table_key_support_get_default_tokenizer (VALUE self)
|
|
625
608
|
NULL);
|
626
609
|
rb_grn_context_check(context, self);
|
627
610
|
|
628
|
-
return GRNOBJECT2RVAL(Qnil, context, tokenizer,
|
611
|
+
return GRNOBJECT2RVAL(Qnil, context, tokenizer, GRN_FALSE);
|
629
612
|
}
|
630
613
|
|
631
614
|
/*
|
@@ -691,6 +674,25 @@ rb_grn_table_key_support_normalize_key_p (VALUE self)
|
|
691
674
|
return CBOOL2RVAL(table->header.flags & GRN_OBJ_KEY_NORMALIZE);
|
692
675
|
}
|
693
676
|
|
677
|
+
/*
|
678
|
+
* call-seq:
|
679
|
+
* table.support_key? -> true/false
|
680
|
+
*
|
681
|
+
* テーブルでキーを使えるなら+true+、使えないなら+false+を返
|
682
|
+
* す。キーを使えないテーブルはGroonga::Arrayだけ。
|
683
|
+
*/
|
684
|
+
static VALUE
|
685
|
+
rb_grn_table_key_support_support_key_p (VALUE self)
|
686
|
+
{
|
687
|
+
grn_obj *table;
|
688
|
+
|
689
|
+
rb_grn_table_key_support_deconstruct(SELF(self), &table, NULL,
|
690
|
+
NULL, NULL, NULL,
|
691
|
+
NULL, NULL, NULL,
|
692
|
+
NULL);
|
693
|
+
return table->header.domain == GRN_ID_NIL ? Qfalse : Qtrue;
|
694
|
+
}
|
695
|
+
|
694
696
|
void
|
695
697
|
rb_grn_init_table_key_support (VALUE mGrn)
|
696
698
|
{
|
@@ -709,8 +711,6 @@ rb_grn_init_table_key_support (VALUE mGrn)
|
|
709
711
|
rb_define_method(rb_mGrnTableKeySupport, "delete",
|
710
712
|
rb_grn_table_key_support_delete, 1);
|
711
713
|
|
712
|
-
rb_define_method(rb_mGrnTableKeySupport, "find",
|
713
|
-
rb_grn_table_key_support_find, 1);
|
714
714
|
rb_define_method(rb_mGrnTableKeySupport, "[]",
|
715
715
|
rb_grn_table_key_support_array_reference, 1);
|
716
716
|
rb_define_method(rb_mGrnTableKeySupport, "[]=",
|
@@ -733,4 +733,7 @@ rb_grn_init_table_key_support (VALUE mGrn)
|
|
733
733
|
|
734
734
|
rb_define_method(rb_mGrnTableKeySupport, "normalize_key?",
|
735
735
|
rb_grn_table_key_support_normalize_key_p, 0);
|
736
|
+
|
737
|
+
rb_define_method(rb_mGrnTableKeySupport, "support_key?",
|
738
|
+
rb_grn_table_key_support_support_key_p, 0);
|
736
739
|
}
|
data/ext/groonga/rb-grn-table.c
CHANGED
@@ -51,7 +51,7 @@ rb_grn_table_from_ruby_object (VALUE object, grn_ctx **context)
|
|
51
51
|
|
52
52
|
VALUE
|
53
53
|
rb_grn_table_to_ruby_object (grn_ctx *context, grn_obj *table,
|
54
|
-
|
54
|
+
grn_bool owner)
|
55
55
|
{
|
56
56
|
return GRNOBJECT2RVAL(Qnil, context, table, owner);
|
57
57
|
}
|
@@ -75,6 +75,7 @@ rb_grn_table_bind (RbGrnTable *rb_grn_table,
|
|
75
75
|
rb_grn_object = RB_GRN_OBJECT(rb_grn_table);
|
76
76
|
rb_grn_table->value = grn_obj_open(context, GRN_BULK, 0,
|
77
77
|
rb_grn_object->range_id);
|
78
|
+
rb_grn_table->columns = Qnil;
|
78
79
|
rb_grn_table->columns = rb_ary_new();
|
79
80
|
}
|
80
81
|
|
@@ -202,7 +203,7 @@ rb_grn_table_inspect_content (VALUE self, VALUE inspected)
|
|
202
203
|
|
203
204
|
/*
|
204
205
|
* call-seq:
|
205
|
-
*
|
206
|
+
* table.inspect -> String
|
206
207
|
*
|
207
208
|
* テーブルの中身を人に見やすい文字列で返す。
|
208
209
|
*/
|
@@ -242,20 +243,14 @@ rb_grn_table_inspect (VALUE self)
|
|
242
243
|
* カラムの値の格納方法について指定する。省略した場合は、
|
243
244
|
* +:scalar+になる。
|
244
245
|
*
|
245
|
-
* [+:scalar+]
|
246
|
-
*
|
247
|
-
*
|
248
|
-
* [+:vector+]
|
249
|
-
* 値の配列を格納する。
|
246
|
+
* [+:scalar+] スカラ値(単独の値)を格納する。
|
247
|
+
* [+:vector+] 値の配列を格納する。
|
250
248
|
*
|
251
249
|
* [+:compress+]
|
252
250
|
* 値の圧縮方法を指定する。省略した場合は、圧縮しない。
|
253
251
|
*
|
254
|
-
* [+:zlib+]
|
255
|
-
*
|
256
|
-
*
|
257
|
-
* [+:lzo+]
|
258
|
-
* 値をlzo圧縮して格納する。
|
252
|
+
* [+:zlib+] 値をzlib圧縮して格納する。
|
253
|
+
* [+:lzo+] 値をlzo圧縮して格納する。
|
259
254
|
*/
|
260
255
|
static VALUE
|
261
256
|
rb_grn_table_define_column (int argc, VALUE *argv, VALUE self)
|
@@ -336,7 +331,7 @@ rb_grn_table_define_column (int argc, VALUE *argv, VALUE self)
|
|
336
331
|
rb_ary_new3(2, self, rb_ary_new4(argc, argv)));
|
337
332
|
}
|
338
333
|
|
339
|
-
rb_column = GRNCOLUMN2RVAL(Qnil, context, column,
|
334
|
+
rb_column = GRNCOLUMN2RVAL(Qnil, context, column, GRN_TRUE);
|
340
335
|
rb_ary_push(columns, rb_column);
|
341
336
|
rb_grn_named_object_set_name(RB_GRN_NAMED_OBJECT(DATA_PTR(rb_column)),
|
342
337
|
name, name_size);
|
@@ -344,6 +339,27 @@ rb_grn_table_define_column (int argc, VALUE *argv, VALUE self)
|
|
344
339
|
return rb_column;
|
345
340
|
}
|
346
341
|
|
342
|
+
static grn_bool
|
343
|
+
n_gram_tokenizer_p(grn_ctx *context, grn_obj *tokenizer)
|
344
|
+
{
|
345
|
+
char tokenizer_name[GRN_TABLE_MAX_KEY_SIZE];
|
346
|
+
int name_size;
|
347
|
+
|
348
|
+
name_size = grn_obj_name(context, tokenizer,
|
349
|
+
tokenizer_name, sizeof(tokenizer_name) - 1);
|
350
|
+
if (name_size == 0)
|
351
|
+
return GRN_FALSE;
|
352
|
+
|
353
|
+
tokenizer_name[name_size] = '\0';
|
354
|
+
|
355
|
+
#define HAVE_PREFIX_P(prefix) \
|
356
|
+
(strncmp(tokenizer_name, prefix, strlen(prefix)) == 0)
|
357
|
+
return (HAVE_PREFIX_P("TokenUnigram") ||
|
358
|
+
HAVE_PREFIX_P("TokenBigram") ||
|
359
|
+
HAVE_PREFIX_P("TokenTrigram"));
|
360
|
+
#undef HAVE_PREFIX_P
|
361
|
+
}
|
362
|
+
|
347
363
|
/*
|
348
364
|
* call-seq:
|
349
365
|
* table.define_index_column(name, value_type, options={}) -> Groonga::IndexColumn
|
@@ -428,8 +444,14 @@ rb_grn_table_define_index_column (int argc, VALUE *argv, VALUE self)
|
|
428
444
|
flags |= GRN_OBJ_PERSISTENT;
|
429
445
|
}
|
430
446
|
|
431
|
-
if (
|
447
|
+
if (NIL_P(rb_with_section)) {
|
448
|
+
if (TYPE(rb_sources) == T_ARRAY && RARRAY_LEN(rb_sources) > 1) {
|
449
|
+
flags |= GRN_OBJ_WITH_SECTION;
|
450
|
+
}
|
451
|
+
} else if (RVAL2CBOOL(rb_with_section)) {
|
432
452
|
flags |= GRN_OBJ_WITH_SECTION;
|
453
|
+
}
|
454
|
+
|
433
455
|
|
434
456
|
if (RVAL2CBOOL(rb_with_weight))
|
435
457
|
flags |= GRN_OBJ_WITH_WEIGHT;
|
@@ -437,16 +459,12 @@ rb_grn_table_define_index_column (int argc, VALUE *argv, VALUE self)
|
|
437
459
|
if (NIL_P(rb_with_position) &&
|
438
460
|
(table->header.type == GRN_TABLE_HASH_KEY ||
|
439
461
|
table->header.type == GRN_TABLE_PAT_KEY)) {
|
440
|
-
grn_id tokenizer_id;
|
441
462
|
grn_obj *tokenizer;
|
442
463
|
|
443
464
|
tokenizer = grn_obj_get_info(context, table,
|
444
465
|
GRN_INFO_DEFAULT_TOKENIZER,
|
445
466
|
NULL);
|
446
|
-
|
447
|
-
if ((tokenizer_id == GRN_DB_UNIGRAM) ||
|
448
|
-
(tokenizer_id == GRN_DB_BIGRAM) ||
|
449
|
-
(tokenizer_id == GRN_DB_TRIGRAM)) {
|
467
|
+
if (tokenizer && n_gram_tokenizer_p(context, tokenizer)) {
|
450
468
|
rb_with_position = Qtrue;
|
451
469
|
}
|
452
470
|
}
|
@@ -463,7 +481,7 @@ rb_grn_table_define_index_column (int argc, VALUE *argv, VALUE self)
|
|
463
481
|
rb_ary_new3(2, self, rb_ary_new4(argc, argv)));
|
464
482
|
}
|
465
483
|
|
466
|
-
rb_column = GRNCOLUMN2RVAL(Qnil, context, column,
|
484
|
+
rb_column = GRNCOLUMN2RVAL(Qnil, context, column, GRN_TRUE);
|
467
485
|
if (!NIL_P(rb_source))
|
468
486
|
rb_funcall(rb_column, rb_intern("source="), 1, rb_source);
|
469
487
|
if (!NIL_P(rb_sources))
|
@@ -513,7 +531,7 @@ rb_grn_table_get_column (VALUE self, VALUE rb_name)
|
|
513
531
|
grn_obj *column;
|
514
532
|
const char *name = NULL;
|
515
533
|
unsigned name_size = 0;
|
516
|
-
|
534
|
+
grn_bool owner;
|
517
535
|
VALUE rb_column;
|
518
536
|
VALUE columns;
|
519
537
|
VALUE *raw_columns;
|
@@ -616,8 +634,10 @@ rb_grn_table_get_columns (int argc, VALUE *argv, VALUE self)
|
|
616
634
|
rb_grn_context_check(context, self);
|
617
635
|
|
618
636
|
rb_columns = rb_ary_new2(n);
|
619
|
-
if (n == 0)
|
637
|
+
if (n == 0) {
|
638
|
+
grn_obj_unlink(context, columns);
|
620
639
|
return rb_columns;
|
640
|
+
}
|
621
641
|
|
622
642
|
cursor = grn_table_cursor_open(context, columns, NULL, 0, NULL, 0,
|
623
643
|
0, -1, GRN_CURSOR_ASCENDING);
|
@@ -631,10 +651,11 @@ rb_grn_table_get_columns (int argc, VALUE *argv, VALUE self)
|
|
631
651
|
grn_table_cursor_get_key(context, cursor, &key);
|
632
652
|
column_id = key;
|
633
653
|
column = grn_ctx_at(context, *column_id);
|
634
|
-
rb_column = GRNOBJECT2RVAL(Qnil, context, column,
|
654
|
+
rb_column = GRNOBJECT2RVAL(Qnil, context, column, GRN_FALSE);
|
635
655
|
rb_ary_push(rb_columns, rb_column);
|
636
656
|
}
|
637
657
|
rc = grn_table_cursor_close(context, cursor);
|
658
|
+
grn_obj_unlink(context, columns);
|
638
659
|
if (rc != GRN_SUCCESS) {
|
639
660
|
rb_grn_context_check(context, self);
|
640
661
|
rb_grn_rc_check(rc, self);
|
@@ -657,7 +678,6 @@ rb_grn_table_have_column (VALUE self, VALUE rb_name)
|
|
657
678
|
grn_obj *column;
|
658
679
|
const char *name = NULL;
|
659
680
|
unsigned name_size = 0;
|
660
|
-
VALUE result = Qfalse;
|
661
681
|
|
662
682
|
rb_grn_table_deconstruct(SELF(self), &table, &context,
|
663
683
|
NULL, NULL,
|
@@ -666,14 +686,12 @@ rb_grn_table_have_column (VALUE self, VALUE rb_name)
|
|
666
686
|
|
667
687
|
ruby_object_to_column_name(rb_name, &name, &name_size);
|
668
688
|
column = grn_obj_column(context, table, name, name_size);
|
669
|
-
if (
|
689
|
+
if (column) {
|
690
|
+
grn_obj_unlink(context, column);
|
691
|
+
return Qtrue;
|
692
|
+
} else {
|
670
693
|
return Qfalse;
|
671
|
-
|
672
|
-
if (column->header.type != GRN_ACCESSOR)
|
673
|
-
result = Qtrue;
|
674
|
-
grn_obj_unlink(context, column);
|
675
|
-
|
676
|
-
return result;
|
694
|
+
}
|
677
695
|
}
|
678
696
|
|
679
697
|
static grn_table_cursor *
|
@@ -773,7 +791,7 @@ rb_grn_table_open_grn_cursor (int argc, VALUE *argv, VALUE self,
|
|
773
791
|
/*
|
774
792
|
* call-seq:
|
775
793
|
* table.open_cursor(options={}) -> Groonga::TableCursor
|
776
|
-
* table.open_cursor(options={}) {|cursor|
|
794
|
+
* table.open_cursor(options={}) {|cursor| }
|
777
795
|
*
|
778
796
|
* カーソルを生成して返す。ブロックを指定すると、そのブロッ
|
779
797
|
* クに生成したカーソルが渡され、ブロックを抜けると自動的に
|
@@ -926,7 +944,7 @@ rb_grn_table_truncate (VALUE self)
|
|
926
944
|
|
927
945
|
/*
|
928
946
|
* call-seq:
|
929
|
-
* table.each {|record|
|
947
|
+
* table.each {|record| } -> nil
|
930
948
|
*
|
931
949
|
* テーブルに登録されているレコードを順番にブロックに渡す。
|
932
950
|
*/
|
@@ -1130,8 +1148,8 @@ rb_grn_table_sort (int argc, VALUE *argv, VALUE self)
|
|
1130
1148
|
|
1131
1149
|
/*
|
1132
1150
|
* call-seq:
|
1133
|
-
* table.group(key, options={}) -> Groonga::Hash
|
1134
1151
|
* table.group([key1, key2, ...], options={}) -> [Groonga::Hash, ...]
|
1152
|
+
* table.group(key, options={}) -> Groonga::Hash
|
1135
1153
|
*
|
1136
1154
|
* _table_のレコードを_key1_, _key2_, _..._で指定したキーの
|
1137
1155
|
* 値でグループ化する。多くの場合、キーにはカラムを指定する。
|
@@ -1214,7 +1232,7 @@ rb_grn_table_group (int argc, VALUE *argv, VALUE self)
|
|
1214
1232
|
results[i].flags = 0;
|
1215
1233
|
results[i].op = GRN_OP_OR;
|
1216
1234
|
|
1217
|
-
rb_result = GRNOBJECT2RVAL(Qnil, context, result,
|
1235
|
+
rb_result = GRNOBJECT2RVAL(Qnil, context, result, GRN_TRUE);
|
1218
1236
|
rb_ary_push(rb_results, rb_result);
|
1219
1237
|
}
|
1220
1238
|
|
@@ -1241,7 +1259,11 @@ rb_grn_table_group (int argc, VALUE *argv, VALUE self)
|
|
1241
1259
|
VALUE
|
1242
1260
|
rb_grn_table_array_reference (VALUE self, VALUE rb_id)
|
1243
1261
|
{
|
1244
|
-
|
1262
|
+
if (FIXNUM_P(rb_id)) {
|
1263
|
+
return rb_grn_record_new_raw(self, rb_id, Qnil);
|
1264
|
+
} else {
|
1265
|
+
return Qnil;
|
1266
|
+
}
|
1245
1267
|
}
|
1246
1268
|
|
1247
1269
|
VALUE
|
@@ -1527,7 +1549,7 @@ rb_grn_table_unlock_ensure (VALUE self)
|
|
1527
1549
|
*
|
1528
1550
|
* call-seq:
|
1529
1551
|
* table.lock(options={})
|
1530
|
-
* table.lock(options={}) {
|
1552
|
+
* table.lock(options={}) {}
|
1531
1553
|
*
|
1532
1554
|
* _table_をロックする。ロックに失敗した場合は
|
1533
1555
|
* Groonga::ResourceDeadlockAvoided例外が発生する。
|
@@ -1703,19 +1725,19 @@ rb_grn_table_is_locked (int argc, VALUE *argv, VALUE self)
|
|
1703
1725
|
* 指定する。演算子は以下の通り。
|
1704
1726
|
*
|
1705
1727
|
* [なし]
|
1706
|
-
* [カラム値] == [値]
|
1728
|
+
* \[カラム値] == [値]
|
1707
1729
|
* [<tt>!</tt>]
|
1708
|
-
* [カラム値] != [値]
|
1730
|
+
* \[カラム値] != [値]
|
1709
1731
|
* [<tt><</tt>]
|
1710
|
-
* [カラム値] < [値]
|
1732
|
+
* \[カラム値] < [値]
|
1711
1733
|
* [<tt>></tt>]
|
1712
|
-
* [カラム値] > [値]
|
1734
|
+
* \[カラム値] > [値]
|
1713
1735
|
* [<tt><=</tt>]
|
1714
|
-
* [カラム値] <= [値]
|
1736
|
+
* \[カラム値] <= [値]
|
1715
1737
|
* [<tt>>=</tt>]
|
1716
|
-
* [カラム値] >= [値]
|
1738
|
+
* \[カラム値] >= [値]
|
1717
1739
|
* [<tt>@</tt>]
|
1718
|
-
* [カラム値]が[値]を含んでいるかどうか
|
1740
|
+
* \[カラム値]が[値]を含んでいるかどうか
|
1719
1741
|
*
|
1720
1742
|
* 例:
|
1721
1743
|
* "name:daijiro" # "name"カラムの値が"daijiro"のレコードにマッチ
|
@@ -1735,18 +1757,17 @@ rb_grn_table_is_locked (int argc, VALUE *argv, VALUE self)
|
|
1735
1757
|
*
|
1736
1758
|
* [+:operator+]
|
1737
1759
|
* マッチしたレコードをどのように扱うか。指定可能な値は以
|
1738
|
-
* 下の通り。省略した場合はGroonga::
|
1739
|
-
*
|
1740
|
-
* [Groonga::
|
1741
|
-
*
|
1742
|
-
*
|
1743
|
-
* [Groonga::
|
1744
|
-
*
|
1745
|
-
*
|
1746
|
-
* [Groonga::
|
1747
|
-
*
|
1748
|
-
*
|
1749
|
-
* マッチしたレコードのスコアを増加。
|
1760
|
+
* 下の通り。省略した場合はGroonga::Operator::OR。
|
1761
|
+
*
|
1762
|
+
* [Groonga::Operator::OR] マッチしたレコードを追加。すで
|
1763
|
+
* にレコードが追加されている場合
|
1764
|
+
* は何もしない。
|
1765
|
+
* [Groonga::Operator::AND] マッチしたレコードのスコアを増
|
1766
|
+
* 加。マッチしなかったレコード
|
1767
|
+
* を削除。
|
1768
|
+
* [Groonga::Operator::BUT] マッチしたレコードを削除。
|
1769
|
+
* [Groonga::Operator::ADJUST] マッチしたレコードのスコア
|
1770
|
+
* を増加。
|
1750
1771
|
*
|
1751
1772
|
* [+:result+]
|
1752
1773
|
* 検索結果を格納するテーブル。マッチしたレコードが追加さ
|
@@ -1831,7 +1852,7 @@ rb_grn_table_select (int argc, VALUE *argv, VALUE self)
|
|
1831
1852
|
GRN_TABLE_HASH_KEY | GRN_OBJ_WITH_SUBREC,
|
1832
1853
|
table,
|
1833
1854
|
NULL);
|
1834
|
-
rb_result = GRNTABLE2RVAL(context, result,
|
1855
|
+
rb_result = GRNTABLE2RVAL(context, result, GRN_TRUE);
|
1835
1856
|
} else {
|
1836
1857
|
result = RVAL2GRNTABLE(rb_result, &context);
|
1837
1858
|
}
|
@@ -1855,7 +1876,7 @@ rb_grn_table_select (int argc, VALUE *argv, VALUE self)
|
|
1855
1876
|
|
1856
1877
|
rb_attr(rb_singleton_class(rb_result),
|
1857
1878
|
rb_intern("expression"),
|
1858
|
-
|
1879
|
+
GRN_TRUE, GRN_FALSE, GRN_FALSE);
|
1859
1880
|
rb_iv_set(rb_result, "@expression", rb_expression);
|
1860
1881
|
|
1861
1882
|
return rb_result;
|
@@ -1942,6 +1963,19 @@ rb_grn_table_merge_bang (VALUE self, VALUE rb_other)
|
|
1942
1963
|
return rb_grn_table_set_operation_bang(self, rb_other, GRN_OP_ADJUST);
|
1943
1964
|
}
|
1944
1965
|
|
1966
|
+
/*
|
1967
|
+
* call-seq:
|
1968
|
+
* table.support_key? -> true/false
|
1969
|
+
*
|
1970
|
+
* _table_に主キーが設定されていれば+true+、されていなければ
|
1971
|
+
* +false+を返す。
|
1972
|
+
*/
|
1973
|
+
static VALUE
|
1974
|
+
rb_grn_table_support_key_p (VALUE self)
|
1975
|
+
{
|
1976
|
+
return Qfalse;
|
1977
|
+
}
|
1978
|
+
|
1945
1979
|
/*
|
1946
1980
|
* call-seq:
|
1947
1981
|
* table.support_sub_records? -> true/false
|
@@ -1962,6 +1996,29 @@ rb_grn_table_support_sub_records_p (VALUE self)
|
|
1962
1996
|
return CBOOL2RVAL(table->header.flags & GRN_OBJ_WITH_SUBREC);
|
1963
1997
|
}
|
1964
1998
|
|
1999
|
+
/*
|
2000
|
+
* call-seq:
|
2001
|
+
* table.exist?(id) -> true/false
|
2002
|
+
*
|
2003
|
+
* _table_に_id_で指定したIDのレコードが存在する場合は+true+、
|
2004
|
+
* 存在しない場合は+false+を返す。
|
2005
|
+
*
|
2006
|
+
* 注意: 実行には相応のコストがかかるのであまり頻繁に呼ばな
|
2007
|
+
* いようにして下さい。
|
2008
|
+
*/
|
2009
|
+
static VALUE
|
2010
|
+
rb_grn_table_exist_p (VALUE self, VALUE id)
|
2011
|
+
{
|
2012
|
+
grn_ctx *context;
|
2013
|
+
grn_obj *table;
|
2014
|
+
|
2015
|
+
rb_grn_table_deconstruct(SELF(self), &table, &context,
|
2016
|
+
NULL, NULL,
|
2017
|
+
NULL, NULL, NULL,
|
2018
|
+
NULL);
|
2019
|
+
return CBOOL2RVAL(grn_table_at(context, table, NUM2UINT(id)));
|
2020
|
+
}
|
2021
|
+
|
1965
2022
|
void
|
1966
2023
|
rb_grn_init_table (VALUE mGrn)
|
1967
2024
|
{
|
@@ -2029,9 +2086,13 @@ rb_grn_init_table (VALUE mGrn)
|
|
2029
2086
|
rb_define_method(rb_cGrnTable, "merge!",
|
2030
2087
|
rb_grn_table_merge_bang, 1);
|
2031
2088
|
|
2089
|
+
rb_define_method(rb_cGrnTable, "support_key?",
|
2090
|
+
rb_grn_table_support_key_p, 0);
|
2032
2091
|
rb_define_method(rb_cGrnTable, "support_sub_records?",
|
2033
2092
|
rb_grn_table_support_sub_records_p, 0);
|
2034
2093
|
|
2094
|
+
rb_define_method(rb_cGrnTable, "exist?", rb_grn_table_exist_p, 1);
|
2095
|
+
|
2035
2096
|
rb_grn_init_table_key_support(mGrn);
|
2036
2097
|
rb_grn_init_array(mGrn);
|
2037
2098
|
rb_grn_init_hash(mGrn);
|